CloudMade/Leaflet — Issue #439: Weird problem with popUp
Author: HooliganQC
Created: 2012-01-16 20:07:03+00:00
State: open

So i'm testing an app right now with two devices :

Galaxy Tab 10.1 on honeycomb 3.1
Nexus One on gingerbread 2.3.6

So my application was working ok since I decided to add popup to my markers.

Behaviour is ok on GalaxyTab, but on my nexus one, there's a problem i'm getting this error :
Object [object Object] has no method '_checkIfEmpty' when i start the app. My polyline doesn't display at all and the popUp for the first marker doesn't display. BUT the other markers' popUp are ok.

That's strange.

Here's a part of my code, note that the app is kinda complex so that's why i'm using global JS variable (window variables). at the end i'm opening the popup for first marker.

$.each(circuitInfo.poi, function(index, value) {

var aMarkerLocation = new L.LatLng(value.lat, value.long,true);
if (poiNumber == 0) firstMarker = aMarkerLocation;
latlngs.push(aMarkerLocation);

if(value.content){
if(index == 0){
$('#poiName').text(value.poi_name);
window['marker' + poiNumber] = new L.Marker(aMarkerLocation);
window['marker' + poiNumber].bindPopup("Point de départ
" + value.poi_name);
}
else{
window['marker' + poiNumber] = new L.Marker(aMarkerLocation);
window['marker' + poiNumber].bindPopup("Point " + (poiNumber+1) + "
" + value.poi_name);
}

map.addLayer(window['marker' + poiNumber]);

poiNumber++
}

});

map.fitBounds(new L.LatLngBounds(latlngs));

if(circuitPath == 1){
//Create a red polyline from an arrays of LatLng points
var polyline = new L.Polyline(latlngs, {color: 'red'});
map.addLayer(polyline);
}

window['marker0'].openPopup();
}

Note that I removed some part of the function that was useless for the demonstration. Also, when I remove the last line (the openPopup(), the error still throws)

Hope you can help!

Thank you very much