Archive for the 'Google Maps' Category

Yahoo! Geocoding now supports UK

I was working on Unthirsty last night when I came across an example of using a particular geocoding plugin. The addresses they were using were in the UK, and I was puzzled because last I checked the UK wasn’t available in any free geocoding API that I could find. So I tried out geocoding a pub in London and what do you know? Yahoo! came up with an accurate result with precision down to the address. So I tried a few more, and they all worked. This is great news, because it allows us to catalog happy hours in the motherland of pubs. I thought I’d share because apparently this has been around for a while and I didn’t even know about it. Anyone looking around for a free geocoding service for the UK, check out the Yahoo! Geocoding API. Also, if your Rails app needs geocoding support, check out Graticule, and see my snippet to make Graticule failover to multiple geocoding services.

Google Maps + IE PNG Hack + IE 7 = Maps Asplode

Yesterday I went to show someone Unthirsty on their home PC. Of course their PC was riddled with malware and ran like a 3-legged dog. I groaned when I saw the IE7 icon on their desktop. I had tested the site a bunch of times in IE 6, but when I saw the IE7 icon I realized I had never tested it with Unthirsty. Reluctantly I opened it and typed in unthirsty.com in the address bar…and can you guess what happens next? The map comes up on the page completely blank. Why is it whenever you go to show someone a site you’re proud of, it doesn’t work?

Originally in Unthirsty I added in a great Javascript hack that makes transparent PNGs work in IE6. This worked great in IE 6, but as you now know, it caused some problems in IE7 when using Google Maps, causing the map to be blank upon loading. If I switched to satellite view it worked, then back to the regular view, the map corrected itself. But obviously that’s not the solution I wanted. So I changed this:

  <!--[if gte IE 5.5]>
  <script type="text/javascript" src="/lib/pngfix.js"></script>
  <![endif]-->

To this:

  <!--[if lt IE 7]>
  <script type="text/javascript" src="/lib/pngfix.js"></script>
  <![endif]-->

If you’re not familiar with the weird if gte IE 5.5, it’s Microsoft’s way of letting you tell versions of Internet Explorer to use what’s in between those comment blocks. Here I’m telling it to include the pngfix.js file if the version of IE is greater or equal to 5.5. Since this also includes IE7, I changed it to include it if the IE version is less than 7. Problem solved.

I hope this helps someone that is having the same problem, but at the same time this should be a wake up call to a lot of developers out there. CHECK YOUR SITES IN INTERNET EXPLORER 7! Especially if you made any hacks to accomodate IE 6 flaws.