Looks like Google Maps went and changed their (admittedly unofficial) javascript API to point to a new version (10) sometime last night, so it looks like the Williamsburger Map section will be down for a while until I can figure out how to hack it back into functioning again.
Update: Looks like Google released a legit API (with documentation!) along with this version, so hopefully the work to fix it will be easier than I’d expected…
Update 2: After a lot of investigation (and some writing of javascript code that I knew had to be commonly done somewhere else), I found a conversation topic on the Google Maps API Google Group that put me on the right track, namely that the _MapsApplication class hadn’t been removed, just altered. Since I’d noticed that the map vs satellite toggle div had been removed from the maps I’d seen on Google Sightseeing, I just removed the line of code that referenced that div element, and all of a sudden, everything worked again!
The quick fix was to replace this:
mapsApplication =
new _MapsApplication( document.getElementById( "container_frb"),
document.getElementById( "panel"),
document.getElementById( "metapanel"),
document.getElementById( "permalink"),
document.getElementById( "toggle"),
document.getElementById( "printheader"),
createMapSpecs( ) );
with this:
mapsApplication =
new _MapsApplication( document.getElementById( "container_frb"),
document.getElementById( "panel"),
document.getElementById( "metapanel"),
document.getElementById( "permalink"),
document.getElementById( "printheader"),
createMapSpecs( ) );
The only remaining problem now is that Google Maps’ API keys are very specific about how your URLs are referenced; if you come into www.williamsburger.com/wb/bedford-ave-williamsburg, the map will work, but if you come into williamsburger.com/wb/bedford-ave-williamsburg (or if I had put any maps inside posts or archive directories or anything) the API complains that the key is no good. I suspect Google will fix that eventually, because mapping keys to directories and specific domains doesn’t seem ideal.
Update 3: Even worse API Key issue: www.williamsburger.com/wb/bedford-ave-williamsburg works, www.williamsburger.com/wb/bedford-ave-williamsburg/ doesn’t. Now that’s just ridiculous.
Update 4: I found a hack on the Google Group to get the www.williamsburger.com vs williamsburger.com issue sorted out.
<script type="text/javascript">
_williamsburger_com_wb_key = "key-number-one";
_www_williamsburger_com_wb_key = "key-number-two";
_google_maps_url_base = "http://maps.google.com/maps?file=api&v=1&key=";
if ( ( window.location.href ).indexOf( "www." ) == -1 ) {
writeScript( _google_maps_url_base + _williamsburger_com_wb_key );
} else {
writeScript( _google_maps_url_base + _www_williamsburger_com_wb_key );
}
function writeScript( src ) {
var ret = '< ' + 'script src="' + src + '"' + 'type="text/javascript"></script>';
document.write(ret);
}
</script>
Once I removed the explicit external loading of the Google Maps API javascript and replaced it with the above, I could hit my urls with or without www at the beginning.
Update 5: I’m hoping that this solution might solve all of the directory and site name problems; it’s the next thing I plan to try out.
Update 6: Here’s another person’s javascript solution to the sidebar issue, using only the official API, as opposed to the GMapsApplication hack I’d originally done. Eventually, I’m guessing I’ll migrate Williamsburger Maps to something similar.
Update 7: Back down again, and the Williamsburger staff are (read as: I am) heading out on vacation to boot. The maps should be back up sometime in mid-July, having been completely redesigned to use only the official API.

December 29th, 2005 at 1:28 am
Hi, I noticed you are a google maps fan too. I’ve been using it on my projects too.
First off, cool site. I live in the city and am always looking for a good place to eat.
Anyway, I read in your archive that you fixed one mapping problem by just removing the toggle div parameter. That was easy. But google changed their api again and this time the fix was not so easy. A lazy person like me hasn’t read the documentation yet. I just want to ask if the fix was major and did you really have to redesign everything? I don’t really expect a reply but thanks alot for reading this. Hope you do well with this site!! Thanks.
January 11th, 2006 at 9:03 am
The upgrade that I mention in update 7 above was pretty major, but I changed a lot of my design while doing it as well, as I learned a bit more about dealing with AJAX calls down to my PHP tier. I don’t recall having to do too much work just to migrate from the pre-API hack to the legitimate API.