DroidScript / Tracker

Bug Tracking and Feature Requests
5 stars 0 forks source link

gmapMarkers error on MapView plugin example in the DS Store #2

Open GT-CBG opened 5 months ago

GT-CBG commented 5 months ago

Hi there, I believe there is an error in the MapView plugin example in the DS Store.

The error is in the file _Map.html inside the function AddMarker()

Every time that a marker is added to a map, the code is supposed to add the new marker to an array called ‘gmapMarkers’. Because of the error this never happens.

Current code:

if(gmap) {
    var marker = new google.maps.Marker(markerOptions);
    marker.setMap(gmap);
    marker.addListener("click", function() { onClickMarker(this); });
}
else gmapMarkers.push(markerOptions); 

Correct code:

if(gmap) {
    var marker = new google.maps.Marker(markerOptions);
    marker.setMap(gmap);
    marker.addListener("click", function() { onClickMarker(this); });
    gmapMarkers.push(markerOptions); 
}

Regards