Answer the question
In order to leave comments, you need to log in
How to check if a token exists?
Good afternoon!
Please help to implement a check for the existence of a marker when dynamically adding it to the map.
I get an array with markers from the database on Ajax, I check
with such a code, then I add it if there was no marker at this location before
function markerExists(lat, lng) {
var exists = false;
var cache = markerCache;
var myLatLng = new google.maps.LatLng(lat, lng);
angular.forEach(cache, function (record, i) {
if(cache[i].getPosition().equals( myLatLng )){
exists = true;
}
});
return exists;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question