With the I-64/I-170 construction, the eruv had to be revised (an incredible job by the eruv committee!) and I had to revise the Google maps eruv on the site. Google maps was the reason I started maintaining the Young Israel site; I read about the API that lets you add your own markers and lines to a map and thought that it would be really cool if we could mark the boundary of the eruv on the satellite map. It turned out to be pretty easy; the code should be clear enough. The problem is what to do if javascript is not enabled. I initially had a <NOSCRIPT> section that contained an <IFRAME> that displayed the maps.google.com page directly, but that was ugly, didn't actually show the eruv, and didn't deal with the case of javascript enabled but Google maps not supported. And NOSCRIPT is certainly not ideal for unobtrusive javascript—where the site works without javascript but works better with it. So, the better answer is to have some non-javascript element that does what we want, then replace it with the Google map if javascript is enabled (and trivially, add a test for GBrowserIsCompatible() to make sure that Google maps are supported). new GMap2(elem) replaces the contents of elem, so that's easy. But what should the default, no-javascript, element be? I finally realized that a static map would work, and the way to get that is to take a screenshot of the real Google map, edited to leave a blank spot where the infowindow goes, and use CSS positioning to put the infowindow in there. Now the scriptless user gets a site almost identical to the real one, but just not interactive.

2 Comments

  1. Willabee says:

    The code link is broken.

  2. Danny says:

    @Willabee:
    Sorry; last year I renamed things to match the jQuery plugin nomenclature.
    I’ve fixed the link now.
    –Danny

Leave a Reply


Warning: Undefined variable $user_ID in /home/public/blog/wp-content/themes/evanescence/comments.php on line 75