Map with sidebar, Google Maps Javascript API V3
Reading KML with the php function simplexml_load_file()

Denmark Select a radio button
Mainland
Vendsyssel
Mors
Als
Aeroe
Sjaelland
Samsoe
Romoe
Laesoe
Lolland_Falstermoen
Langeland
Fyn
Fanoe
Anholt
Bornholm

Hide all
Show all

I have created Online Google maps v3 tool that I use for making maps to my site Birdtheme. I do not really need the kind of map I have created here on my website yet, but playing with Google maps API is fun.

You can't obtain the data you need to create a sidebar if you render a KML file on a map with 'new google.maps.KmlLayer(url of the kml file)'. If you do it this way, it is not dynamic, users can't interact with your shapes, because you don't have access to individual markers, polylines and polygons to write code for a sidebar. There are solutions for loading and reading KML files and obtaining data for individual shapes.
geoxml3 - KML processor for the Google Maps JavaScript API V3
Common Loader - using util.js

The method used here is to import KML (or XML) files using the php function simplexml_load_file(). With this function you can search for nodes and collect their values in arrays or strings and convert them to Javascript arrays when needed. I use radio buttons in the sidebar. Buttons and links can easily be used instead.
Here is my php code

width="31" height="31" border="0" alt="Home">            Contact: googlemaptool@birdtheme.org
If you copy this page, please delete the Google Analytics page tracker