Add titles to Placemark from KML feed

475 views
Skip to first unread message

Israel Brewster

unread,
May 27, 2011, 1:35:27 PM5/27/11
to google-map...@googlegroups.com
I have a number of placemarks that are displayed on a in google maps via a KML overlay. If I load the kml in google earth these placemarks show their titles next to them, but not in google maps. Is there any way to get the placemarks to display their titles in maps as well? 

I've seen some references to "elabel", but if I understand it correctly I have to put code in my webpage to generate the elabel markers, which wouldn't work since I don't know what markers I will have (or where) until the KML is loaded. Since loading the KML is handled by the Maps API, my webpage would never know where to make the markers. What other options do I have?

Israel Brewster

unread,
Jun 3, 2011, 12:01:12 PM6/3/11
to google-map...@googlegroups.com
So, should I take the lack of response to mean none? Is elabel the only way to go? If so, does anyone have any suggestions on how I can use it in this scenario? Thanks.

geoco...@gmail.com

unread,
Jun 3, 2011, 2:14:30 PM6/3/11
to Google Maps JavaScript API v3
1. elabel has not (to my knowledge) been ported to v3
2. the InfoBox in v3 can be used to create labels
3. I'm not sure how complex your kml is, but if "a number of
placemarks" is small enough you could look at using geoxml3 to display
your kml (KmlLayer won't give you access to the markers), and create
code that would put labels on the Placemarks. You could also add a
"title" to the markers that could display a tooltip rather than a
label.

Example putting labels on a map with kml on it (but not using the kml
to place the labels):
http://www.geocodezip.com/ParkerPalmSprings.html

-- Larry
Reply all
Reply to author
Forward
0 new messages