Answer the question
In order to leave comments, you need to log in
Will add or remove points on the Yandex map when clicking?
Good afternoon, there is such a structure
<div id="button">click-me</div>
<div class="all-adress">
<div class="address">
<span>55.773702</span>
<span>37.599220</span>
</div>
<div class="address">
<span>55.773732102</span>
<span>37.599220</span>
</div>
<div class="address">
<span>55.773123702</span>
<span>37.599212320</span>
</div>
<div class="address">
<span>535.773702</span>
<span>37.5939220</span>
</div>
<div class="address">
<span>525.773702</span>
<span>37.3</span>
</div>
</div>
Answer the question
In order to leave comments, you need to log in
https://tech.yandex.ru/maps/jsbox/2.1?from=jsapi
as you noticed, first a label object is created, and then it is added
//Глобальный контекст
var myMap,myPlacemark;
// контекст создания карты
myMap = new ymaps.Map(...);
//контекст нажатия кнопки 1
myPlacemark = new ymaps.Placemark([lat, lon],{...});
myMap.geoObjects.add(myPlacemark);
//контекст нажатия кнопки 2
myMap.geoObjects.remove(myPlacemark);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question