zahidsw / geoxml3

Automatically exported from code.google.com/p/geoxml3
0 stars 0 forks source link

Wrong check if marker already exists #12

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
there are nested for loop with the same variable i and a missing variable is 
used in the code:

for (i = 0; i < doc.markers.length; i++) {
    if (doc.markers[i].getPosition().equals(markerOptions.position)) {
        found = doc.markers[i].active = true;
        break;
    }
}

fixed code:

for (j = 0; j < doc.markers.length; j++) {
    var position = new google.maps.LatLng(placemark.point.lat, placemark.point.lng);
    if (doc.markers[j].getPosition().equals(position)) {
        found = doc.markers[j].active = true;
        break;
    }
}

Original issue reported on code.google.com by Zhelyo.H...@gmail.com on 4 Oct 2010 at 2:47

GoogleCodeExporter commented 9 years ago
Do you have a test case that will expose the problem?

Original comment by geocodezip on 5 Oct 2010 at 1:27

GoogleCodeExporter commented 9 years ago

Original comment by geocodezip on 8 Oct 2010 at 6:28