{"id":9,"date":"2008-03-07T20:21:46","date_gmt":"2008-03-08T04:21:46","guid":{"rendered":"http:\/\/shanelabs.com\/blog2\/?p=9"},"modified":"2011-12-15T21:46:01","modified_gmt":"2011-12-16T05:46:01","slug":"google-maps-is-null-or-not-an-object-error","status":"publish","type":"post","link":"https:\/\/shanelabs.com\/blog\/2008\/03\/07\/google-maps-is-null-or-not-an-object-error\/","title":{"rendered":"Google maps: is null or not an object error"},"content":{"rendered":"<p>I\u2019ve got a google maps application on an ASP.NET ajax enabled page through an update panel. I had used setInterval to run a javscript function periodically and update the markers on the map. Over time, I noticed that when the map was updated through ajax while the javascript code was executing, i got the one of the following two errors:<\/p>\n<blockquote><p><code>'__e_' is null or not an object<br \/>\n'undefined' is null or not an object<\/code><\/p><\/blockquote>\n<p>These errors didn\u2019t seem to have any effect, other than a javascript error being noted.<\/p>\n<p>Through debugging, I determined that it was because of GEvent.addListener(), GEvent.clearListeners(), and marker.setImage(). Because I was getting real time updates, it was ok if every once in a while these things didn\u2019t get updated &#8211; I could just ignore it and it probably will be updated next round. So, if you simply put these calls in a try\/catch block, the errors don\u2019t get generated.<\/p>\n<pre>try\r\n{\r\n\tmarker.setImage(newImagePath);\r\n}\r\ncatch(err){} \/\/it's ok to fail here - ignore it.<\/pre>\n<p>Good luck!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I\u2019ve got a google maps application on an ASP.NET ajax enabled page through an update panel. I had used setInterval to run a javscript function periodically and update the markers on the map. Over time, I noticed that when the map was updated through ajax while the javascript code was executing, i got the one [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[3],"tags":[],"class_list":["post-9","post","type-post","status-publish","format-standard","hentry","category-software"],"_links":{"self":[{"href":"https:\/\/shanelabs.com\/blog\/wp-json\/wp\/v2\/posts\/9","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/shanelabs.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/shanelabs.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/shanelabs.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/shanelabs.com\/blog\/wp-json\/wp\/v2\/comments?post=9"}],"version-history":[{"count":5,"href":"https:\/\/shanelabs.com\/blog\/wp-json\/wp\/v2\/posts\/9\/revisions"}],"predecessor-version":[{"id":130,"href":"https:\/\/shanelabs.com\/blog\/wp-json\/wp\/v2\/posts\/9\/revisions\/130"}],"wp:attachment":[{"href":"https:\/\/shanelabs.com\/blog\/wp-json\/wp\/v2\/media?parent=9"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/shanelabs.com\/blog\/wp-json\/wp\/v2\/categories?post=9"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/shanelabs.com\/blog\/wp-json\/wp\/v2\/tags?post=9"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}