So I’m trying to compare points currently, and I’m using a small loop and a log, but the loop ALWAYS evaluates to false, even when it’s true. For example, the console will show that the positions should evaluate to true, but end up evaluating to false:

My code snippet for this loop looks as such:
var temp = new google.maps.LatLng(lat,lng);
for (var i=0; i<gmarkers.length; i=i+2) {
console.log('gmarkers[i].getPosition() = '+gmarkers[i].getPosition());
console.log('temp = '+temp);
console.log(gmarkers[i].getPosition()==temp);
...
...
I’m wondering if there’s any sort of extra parsing that needs to be done to evaluate this code correctly, or how to compare the points besides using the “==” or “===” operator?
LatLng has an equals method to compare LatLngs. Try that instead.