Answer the question
In order to leave comments, you need to log in
How to change the coordinates of the Yandex map marker?
Tell me how to change the coordinates of the marker when clicking on the item.
Map Code
var myMap;
var myPlacemark;
var init = function init() {
myMap = new ymaps.Map("map", {
center: [55.782889, 37.725994],
zoom: 18,
controls: []
});
myMap.behaviors.disable('scrollZoom');
var myPlacemark = new ymaps.Placemark([55.782636, 37.726417], {}, {
iconLayout: 'default#image',
});
myMap.geoObjects.add(myPlacemark);
};
ymaps.ready(init);
$('.contacts .tab').on('click',function(){
// Contacts Lat and Log
lat = 55.782889;
lng = 37.725994;
myPlacemark.setCoordinates([ lat, lng]); // Это пример, он не работает
})
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