Google Maps API

I spent most of this afternoon playing around with the Google Maps API. I created a page that highlighted many of the local coffee resources. It was a little more difficult than I was expecting, but mostly I think that was due to my relative unfamiliarity (is that even a word?) with Javascript. It’s been years since I’ve used it.

If anyone takes a look at the code, which was hacked together from a couple of the examples on Google, you might question why I created the addMarker function. I think that I might have found a tiny little bug in Firefox, even though it might just be an issue with Javascript. Initially I had all that code embedded in the for loop a couple of lines above. No matter which marker you clicked, the Information Window would always open over the last one that was created. For some reason throwing everything into a seperate function got it working.

Finally, one of the things that is seriously great about this API is that GXml object. That simplified everything a great deal. At this point it would be a very simple matter for me to just create a PHP page that generates that XML and then I could store everything in a database.

Leave a Reply

You must be logged in to post a comment.