Create a map with the API
(In order for a map to be 'API visible' it must be created with the API.)
Using the interface at maps.google.com, create something that looks
like what you want to add with the API
Now using the API, download this feature's kml. Remove any parts that
are specific to that item. This is your
template. Use this template and string substitution to make kml for
new features.
here's my template for linestrings:
'<ns0:entry xmlns:ns0="http://www.w3.org/2005/Atom"
xmlns:ns1="http://schemas.google.com/g/2005"><ns0:category
scheme="http://schemas.google.com/g/2005#kind"
term="http://schemas.google.com/maps/2008#feature"
/><ns0:author><ns0:name>adventureseed</ns0:name></ns0:author><ns0:content
type="application/vnd.google-earth.kml+xml"><ns2:Placemark
xmlns:ns2="http://www.opengis.net/kml/2.2"><ns2:name>%s</ns2:name><ns2:description>%s</ns2:description><ns2:Style><ns2:LineStyle><ns2:color>%s</ns2:color><ns2:width>%s</ns2:width></ns2:LineStyle></ns2:Style><ns2:LineString><ns2:tessellate>0</ns2:tessellate><ns2:coordinates>%s</ns2:coordinates></ns2:LineString></ns2:Placemark></ns0:content><ns0:contributor><ns0:name>adventureseed</ns0:name></ns0:contributor><ns0:title>%s</ns0:title></ns0:entry>'
and my template for points:
'<Placemark><name>%s</name><description><![CDATA[<a
href="http://adventureseed.appspot.com/seed/view/%s">%s</a>%s...]]></description><Point><coordinates>%s,%s</coordinates></Point></Placemark>'
Now make a Feature from that string:
map_item = gdata.maps.data.Feature()
map_item.content = gdata.maps.data.KmlContent(kml=my_map_item_string)
map_item.title = atom.data.Title(text=title)
And upload this!
I'm not sure if this is the only way, but I spent a long time trying
to get other, more documented methods to work and that failed pretty
hard.
Best of luck.
Sent from my iPhone
On Jul 22, 2010, at 7:27 AM, Michael <mic...@tyson.id.au> wrote:
> Submitted issue 2590: http://code.google.com/p/gmaps-api-issues/issues/detail?id=2590
>
> --
> You received this message because you are subscribed to the Google
> Groups "Google Maps Data API" group.
> To post to this group, send email to google-map...@googlegroups.com
> .
> To unsubscribe from this group, send email to google-maps-data...@googlegroups.com
> .
> For more options, visit this group at http://groups.google.com/group/google-maps-data-api?hl=en
> .
>
Same for me. Already stared the issue 2590.
--