{"id":1261,"date":"2022-08-30T15:15:03","date_gmt":"2022-08-30T15:15:03","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/10\/google-maps-v3-object-is-null-or-undefined-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:15:03","modified_gmt":"2022-08-30T15:15:03","slug":"google-maps-v3-object-is-null-or-undefined-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/google-maps-v3-object-is-null-or-undefined-collection-of-common-programming-errors\/","title":{"rendered":"Google Maps v3 Object is null or undefined-Collection of common programming errors"},"content":{"rendered":"<p>I am getting &#8220;Unable to get value of the property &#8216;3&#8217;: object is null or undefined&#8221; at this line of code in IE7 and IE8 and don&#8217;t know how to solve it. Any help greatly appreciated.<\/p>\n<pre><code>marker = new google.maps.Marker\n<\/code><\/pre>\n<p>I&#8217;m not sure what it means by undefined as I have declared the variable in the previous code block. Any help greatly appreciated&#8230;http:\/\/jsfiddle.net\/svuce\/1\/<\/p>\n<pre><code>function initialize() {\n    var markers = new Array();\n    var locations = [\n      ['Donegal', 'Some text goes here<br \/>text', 'walking', -33.900542, 151.174856],\n      ['Bondi Beach', 'Some text goes here<br \/>text', 'walking', -33.890542, 151.274856],\n      ['Coogee Beach', 'Some text goes here<br \/>text', 'golfing', -33.923036, 151.259052],\n      ['Cronulla Beach', 'Some text goes here<br \/>text', 'family', -34.028249, 151.157507],\n      ['Manly Beach', 'Some text goes here<br \/>text', 'explore', -33.80010128657071, 151.28747820854187],\n      ['Maroubra Beach', 'Some text goes here<br \/>text', 'cycling', -33.950198, 151.259302],\n    ];\n\n\n    var map = new google.maps.Map(document.getElementById('map-canvas'), {\n      zoom: 10,\n      center: new google.maps.LatLng(-33.92, 151.25),\n      mapTypeId: google.maps.MapTypeId.ROADMAP\n    });\n\n    var infowindow = new google.maps.InfoWindow();\n    var marker, i;\n\n    for (i = 0; i &lt; locations.length; i++) {  \n        marker = new google.maps.Marker({\n            position: new google.maps.LatLng(locations[i][3], locations[i][4]),\n            map: map,\n            icon: 'images\/map_'+locations[i][2]+'_image.png'\n        });\n\n        markers.push(marker);\n\n        var boxText = document.createElement(\"div\");\n\n      google.maps.event.addListener(marker, 'click', (function(marker, i) {\n        return function() {\n            boxText.style.cssText = \"border: none 0; margin-top: 8px; background:#fff; padding: 8px;border:1px solid #877856;\";\n            boxText.innerHTML = locations[i][0]+\"<br \/>\"+locations[i][2]+\"<br \/>\"+locations[i][1]+\"<img src='images\/tipbox.png' class='infobox-arrow' \/>\";\n\n            $(\".infobox-close\").remove();\n\n            var myOptions = {\n                     content: boxText\n                    ,disableAutoPan: false\n                    ,maxWidth: 0\n                    ,pixelOffset: new google.maps.Size(-140, -180)\n                    ,zIndex: null\n                    ,boxStyle: { \n                      opacity: 1\n                      ,width: \"280px\"\n                     }\n                    ,closeBoxMargin: \"12px 7px 0 0\"\n                    ,closeBoxURL: \"http:\/\/www.google.com\/intl\/en_us\/mapfiles\/close.gif\"\n                    ,infoBoxClearance: new google.maps.Size(1, 1)\n                    ,isHidden: false\n                    ,pane: \"floatPane\"\n                    ,enableEventPropagation: false\n            };\n            var ib = new InfoBox(myOptions);\n          ib.open(map, marker);\n        }\n      })(marker, i));\n    }\n\n    \/\/ == shows all markers of a particular category, and ensures the checkbox is checked ==\n      function show(category) {\n        for (var i=0; i<\/code><\/pre>\n<p id=\"rop\"><small>Originally posted 2013-11-10 00:12:41. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>I am getting &#8220;Unable to get value of the property &#8216;3&#8217;: object is null or undefined&#8221; at this line of code in IE7 and IE8 and don&#8217;t know how to solve it. Any help greatly appreciated. marker = new google.maps.Marker I&#8217;m not sure what it means by undefined as I have declared the variable in [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1261","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1261","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=1261"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1261\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=1261"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=1261"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=1261"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}