You are heremaps

maps


Saravana Perumal's picture

Google Maps API

BillShrink | Free personalized advice for saving you money
  • Yesterday morning, we got complaints from users saying that Google Maps on our application were not loading.
  • We had not done a production push the previous night. So the immediate conclusion was that there must be something wrong on their side, as we had the max queries per second issue the previous week.
  • This one was wierd in the sense that the Google Maps itself was not loading. It was throwing a javascript exception on load, something like window.jstiming undefined.
  • So to check if it was to do with the Google Maps API,i created a simple html page with just the Google Maps, and that didnot load either. Definitely an issue on their end !.
  • But it just can't be that they pushed out some code without QA'ing properly.
  • So went back to my code to see if i am calling it the wrong way. The call i was making was <script type="text/javascript" src="http://www.google.com/jsapi?key=ABCDEFG"></script> <script type="text/javascript"> google.load("maps", "2.x"); // Call this function when the page has been loaded function initialize() { var map = new google.maps.Map2(document.getElementById("map")); map.setCenter(new google.maps.LatLng(37.4419, -122.1419), 13); } google.setOnLoadCallback(initialize); </script>
  • Hmm, this google.load("maps", "2.x");, "2.x" looked odd.
  • So i looked up the Google Maps API Documentation, there it was mentioned "The v parameter within the http://maps.google.com/maps?file=api&v=2 URL refers to the version number of the Google Maps API to use. Most users of the API will want to use the current "Version 2" API by passing the v=2 parameter within that URL. You may instead obtain the latest release (including the latest features) by passing v=2.x instead. However, be aware that the latest release may not be as reliable as the v=2 release. We update the Google Maps API often (sometimes every week), at which point features within the v=2.x release are migrated into the v=2 release unless problems are discovered. In addition, you may use a "stable" version of the API by passing the v=2.s parameter. This version is updated less often, about every few months. Since the v=2 and v=2.x releases are updated about every two weeks, some developers will prefer to use the stable v=2.s. Please note that the stable version may be several versions behind the current version and therefore may not include some of the latest features."
  • So i replaced "2.x" with "2", and the map loaded just fine. Solution found :-)
  • In the mean while balki also found the solution at window.jstiming.Timer is null or not an object, So he made the neccessary changes to the branch and pushed it to production.
  • So the next time you run into an issue similar to this, just keep in mind to check the version parameter. ;-)

Who's online

There are currently 0 users and 2 guests online.