Setting the Placemark ID

164 views
Skip to first unread message

Nymor

unread,
Dec 9, 2009, 7:17:47 PM12/9/09
to KML Developer Support - Google Earth Plug-in
Hi,

I'm sure this must be simple but I just can't find it....

How do I set the ID of a Placemark when creating it in code?

I have some placemarks that I load from a KML file and they have IDs
that I retrieve using getId()

What I want to do is to assign an ID to placemarks that I create
inline.

Thanks
Nymor

Andy4834

unread,
Dec 10, 2009, 6:04:26 AM12/10/09
to KML Developer Support - Google Earth Plug-in
Nymor
Placemark IDs are assigned at the time when you create the Placemark.
So code such as:
ge.CreatePlacemark("myID")
where ge is the Google Earth instancde will create a Placemark with an
id of "myID". There are the usual constraints with regard to
uniqueness for IDs.
Have a look at
http://code.google.com/apis/earth/documentation/reference/interface_g_e_plugin.html#db48f85de97abb87230fafe2403cbd1e
for more details.
Hope this helps
Andy
Reply all
Reply to author
Forward
0 new messages