KML Map and external anchor.

23 views
Skip to first unread message

. Emanuele .

unread,
Sep 2, 2011, 8:52:58 AM9/2/11
to google-map...@googlegroups.com
I have a google map filled in with some locations saved into a kml file. I would like to link each one of them with a link into some text outside the map (but inside the page).
For example the html < a href="showlocation(3)">text</ a> should make the location 3 appear and open its baloon.
How can I do it?

Thanks.

Grok Lobster

unread,
Sep 2, 2011, 12:00:56 PM9/2/11
to Google Maps JavaScript API v3
Easiest way that I know of is to separate your kml into multiple
files.

JFrancis

unread,
Sep 2, 2011, 12:04:17 PM9/2/11
to google-map...@googlegroups.com
I believe you are looking for something like Mike Williams' "Clickable Sidebar" which loads the data from an XML file:
http://www.geocodezip.com/v3_MW_example_map3.html

There are others here who have accomplished the same thing with KML files.

JF

geoco...@gmail.com

unread,
Sep 2, 2011, 8:32:35 PM9/2/11
to Google Maps JavaScript API v3
Currently the objects loaded by KmlLayer are not accessible
externally, only via the build in click events.

For kml there are two options I know of:
1. use a third party parser (geoxml3 is the only one I know of), that
renders the kml as "normal" maps markers, polylines and polygons and
allows you to access them externally.
2. import the kml into fusion tables, code GViz queries to simulate
the behavior of the fusion tables click events.
(there are probably other ways as well)

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