I bumped into a problem as I am adding infowindows to my markers. Although they all appear nicely and if i click on them, the windows appear, i seem to encounter a bug, and I cant figure out what it wants.
The problem lies when I click on a marker and the window appears with all the information. I get an: “Uncaught TypeError: Object [object Object] has no method ‘N'” error, in the main.js, something that is generated by Sencha Architect itself.
It displays however the information, and i can still open multiple screens, but the close screens dont work, which off course i want, cause i dont see reason why 150 different markers should all show content screens if i cant close them.
My code for the create marker function is as followed (note that his is run in a loop to create 150 markers)
var infoWindow;
// Creating a marker
var title = data.stembureau_2;
var yay = map.getMap();
var icon = 'markers/SGA.png';
var gpa = data.gpa;
if (gpa == 'Ja'){
icon = 'markers/GPA.png';
}
var marker = new google.maps.Marker({
position: new google.maps.LatLng(data.latitude, data.longitude),
map: yay,
title: title,
icon: icon
});
// Creating an InfoWindow object
var content = data.stembureau_1;
infoWindow = new google.maps.InfoWindow({
content: content
});
// Loading the Infowindow on a click event
google.maps.event.addListener(marker, "click", function() {
infoWindow.open(map, this);
});
// Closing the Infowindow on a click event
closeInfoWindow = function() {
infoWindow.close();
};
google.maps.event.addListener(map, 'click', closeInfoWindow);
return marker;
fixed it already, quite simple. I refered earlier to yay as the map-object, which down i didnt. small error on my part i constantly overread! anyway, thank you.