I have an AJAX request. Runs every five seconds.
$.ajax({ type: "GET", url:"{{URL::action('GpsController@GPSOnline') }}", dataType: 'json', // Выводим координаты из 1.php success: function(data){ myCollection.removeAll() ; console.log(data); var a = data; if (a.length > 0) { for (var i=0;i<a.length;i++) { var ch = a[i].ch, poz=a[i].poz, la = a[i].la, lo =a[i].lo; var img = "/../../../images/poz.php?ch="+ch+"&poz="+poz+"&rnd="+poz; console.log(img); ymaps.option.presetStorage.add("my#customIcon"+ch+poz, { iconImageHref: img, iconImageOffset: [-12, -12], iconImageSize: [34, 34] }); myPlacemark = new ymaps.Placemark( [la, lo],{iconContent:"" }, {preset: "my#customIcon"+ch+poz}, {draggable: true}); myCollection.add(myPlacemark); b = myCollection ; }} myMap.geoObjects.add(myCollection); function getZoom(){ if (document.getElementById('checks').checked==true){ // Автомассштаб myMap.setBounds(myMap.geoObjects.getBounds()); } else { } } getZoom(); } , error: function(){ alert('AJAX заспрос не отработал!'); } }); } How can I transfer the values from the myPlacemark object to the b object and compare them (are they the same or not)?