Thursday, May 26, 2005

maps and legends

Edit: Google Maps released a public API, so this technique doesn't work anymore and isn't needed. Info on the new API can be found here.

=============

I've been playing around with Google Maps a bit, trying to learn how they work. The code is pretty obfuscated, but luckily it cleans up well... I went through renaming variables and functions that I could identify the purpose of, and the rest of it eventually became clear.

X

Assuming you use a browser that works (sorry Opera and Konqueror and maybe Safari, cool browsers but not too standards compliant), you should see a working Google map above this text. On Firefox it is fully functional: pan and zoom, drag with the mouse, toggle between map and satellite view.

I'm not sure what I am going to do with it yet... I think I may make something similar to Paul Rademacher's HousingMaps, but include access to PortlandMaps, the government database of property, tax, crime, and utilities in Portland. It would be useful for house hunters to be able to see what their property taxes will be and what the crime rate in the neighborhood is like, all on one Google map.

FOLLOWUP: looks like it works in Safari (thanks Tina). There have been some almost random occurences of the XML file not loading correctly, which leaves the map centered over a lake in Kansas instead of Portland... I suspect this is a race condition, the XML file isn't loading in some minimum amount of time so the page loads without it. I'll tweak the code a bit and see what I can come up with.

4 Comments:

Blogger Lenka Reznicek said...

Yes, it certainly does work in Firefox...although I initially got a big 'ol lot of blue water (defaulted to fully zoomed in?) until I found the land. Interesting possibilities!
 

Blogger Foobario said...

Thanks for the info... I just tried this on another machine and sho nuff, it's ignoring my "go to Portland" directions. The files that tell it to do so were probably all comfortably cached on my machine.
 

Blogger Foobario said...

Evidently Waconda lake in Kansas is the geographic center of the US as far as Google Maps is concerned, and at full zoom you're right in the center of it.
 

Blogger tina said...

It looks beautiful and works great in Safari 1.3 (v312). Very cool! Tina (aka kinnarium) P.S. I loved the photo of your house ... what a beautiful place!
  Post a Comment
return to front page