Uncaught TypeError: Cannot read property '__e3_' of undefined-Collection of common programming errors
I’m develop an aplication with vb.net and google maps v3, and i’m trying create a map with next properties
$(document).ready(function (){
var sPath ="images/AppIcons/Vehicles/icon05.png,";
var markers= new google.maps.Marker({
position : new google.maps.LatLng(4.759915, -74.04083),
map : map,
icon : new google.maps.MarkerImage(+ sPath + null, null, null, new google.maps.Size(32, 32)),
animation: google.maps.Animation.DROP,
title : "buena"
});
var myLatlng = new google.maps.LatLng(0, 0);
var mapOptions={zoom: 3,center: new google.maps.LatLng(4.590798,-74.084244),mapTypeId: google.maps.MapTypeId.ROADMAP };
var map = new google.maps.Map(document.getElementById('map_canvas'), mapOptions);
var marker = setMarkers(map);
var infowindow = new google.maps.InfoWindow({Content : 'FM3200 - FM3200 20/01/2013 04:30:56 p.m. - Voltaje Externo - (Norte)Ubicacion Invalida In1:0 In2:0 In3:0 Batext:4.45V Vel:0 Odom:0 Ibutton:0 Oficina Principal Risk, Kmh: 0'});
if (markers !='') {
google.maps.event.addListener(marker, 'click', function() {
infowindow.open(map,marker);
/*if (marker.getAnimation() != null) {
marker.setAnimation(null);
} else {
marker.setAnimation(google.maps.Animation.BOUNCE);
}*/
});
}
});
function setMarkers(map,markers) {
var marker =markers;
if (marker !='') {
return marker;
}
}
When play this code apear this message of error
Uncaught TypeError: Cannot read property '__e3_' of undefined main.js:18
How can solved this error Thanks for your help..
-
Move the creation of
map
to the top of the function.Currently you use
map
asmap
-option formarkers
, where it’s expected to be agoogle.maps.Map
-instance(but it’s undefined, because the map isn’t created yet)
Originally posted 2013-11-10 00:17:18.