0

I'm using Google Maps API v3 and am displaying a basic map with about 250 place markers from a KMZ file. I'd like to add a search box to the page that allows users to search for a specific item in the KML. I'm pretty sure this is possible, but am not sure about the best way to get started... any help pointing me in the right direction would be much appreciated.

Thanks.

MKnapp
  • 3
  • 1

1 Answers1

0

As I understand, a KMZ file is a zipped file containing the .KML file and other related files. Reading the KML and extracting values from it is trivial using jquery and you can get information about how to do it here. http://think2loud.com/224-reading-xml-with-jquery/

I've not done unzipping a file in javascript, but you can check out this StackOverflow question if you want to do everything on the client side. Unzipping files

Alternately, you can unzip the KMZ file on the server, and let the client code get the KML file using an AJAX get (as shown in the first link).

Hope this helps.

Community
  • 1
  • 1
Scorpion-Prince
  • 3,574
  • 3
  • 18
  • 24
  • It does help. Thanks very much for the input. Based on what you said, and from what I've seen out in other forums, it does look like searching through a KML/KMZ file would require parsing the KML/KMZ either on client or server side, then setting up a search function using jquery. That being said, I also discovered that you can upload a KML into Google's Fusion Tables, then generate a pretty nice map, with extremely simple query functionality. This website sums it up pretty well: http://gmaps-samples.googlecode.com/svn/trunk/fusiontables/fusiontableslayer_builder.html – MKnapp Mar 10 '12 at 01:48