• Home
  • Idea Book

An Unfortunate Truth

December 9th, 2007

Sitting on a third floor table of Allen Hall (the journalism and communication school) at the University of Oregon my my colleagues pass by asking “mapping?” I sight and respond with a smile “nothing but.”

The reason for this sigh has revealed itself as a disappointing yet without persuasion truth. FireFox is indeed not the browsers best friend.

For several weeks I could not figure out why only Firefox would plot addresses from an XML file on a Google map in the same order each time. Safari and IE would plot points in an order arbitrary to the order of the XML file. Well the reason that FireFox was the only one that worked properly was because it is in fact the slowest browser.

Here’s the lowdown: To plot addresses on a Google map they need to be geocoded. Google needs latitude and longitude to plot a point on a map. well here lies the problem. Google takes time to respond to the geocode request. So if the code doesn’t have patience and goes right on plotting before the response things will get out of order because the plotting and receiving of the latitude and longitude and not synchronized.

So because FireFox took its sweet time to execute the code Google had time to respond whereas Safari and IE whizzed through the code before Google had time to fully respond.

Here’s the Solution: Use setInterval to delay to the code a bit while Google is responding. I will give you a bit more of my code, but not too much that you will find out exactly what i am doing before official release.


var address = addresses[i];
var nextAddress = (res.length-1);
window.theNext = function() {
if (nextAddress < addresses.length) {
setTimeout('getAddress("'+addresses[nextAddress]+'",theNext)', 50);
nextAddress--;
}
}

del.icio.us Slashdot Digg Facebook Technorati Google StumbleUpon Bookmark.it Diigo Squidoo

Posted in APIs, Javascript, Web Development

No Responses to “An Unfortunate Truth”

  1. There are currently no comments on this entry, want to be the first? Use the form on the right.






  • Just another Blog and narcissistic self esteem builder. If you think I have anything to say take a second and let me know - Post a comment - and you too can shamelessly promote yourself just as I do here. Have Fun!
  • Archives

    • May 2008
    • April 2008
    • March 2008
    • February 2008
    • January 2008
    • December 2007
    • November 2007
    • July 2007
  • Categories

    • Advertising
    • APIs
    • Cool Shit
    • CSS
    • Cyber Culture
    • Digital Marketing Conference
    • Idea Book
    • Javascript
    • Live
    • MySQL
    • Rant
    • Tools
    • Uncategorized
    • Web Development
    • Wordpress
  • Blogroll

    • 1 + 1 = 11
    • A List Apart
    • A Moment of Wonderful
    • Dave Shea
    • Deb Morrison
    • Logic + Emotion
    • Love is a Verb
    • Mashable
    • Micro Persuasion
    • Photomatt
    • Professor Christy’s Blog
    • Step into my World…
    • Straight Up With BK
  • Tags

    AJAX API Book Class Cool CSS Facebook FedEx Flash geocoding Google Google Maps ID Idea Book Images Innovation iPhone Javascript Jonathan Harris JSON Life MySQL News OpenSource Overview PackMapr PEAR HTTP_Request PHP Pingdom Politics Programming RSS School Starbucks Stats Tools Tutorial University of Oregon UPS USPS Web Trends Weiden + Kennedy What if Wordpress youTube

Powered by Wordpress | Design by Zach Blank
XHTML Strict | RSS Entries