Add or remove by clicking points on the map Yandex?

Good afternoon, there is such 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>


On button click I get all the divas into a variable with the address class.
How to add them to the map.
Walk cycle, and pull out of each point Longitude and latitude is know how, the only question is, what funtion Yandex map add to map + with its own icon?
And is there an analogue to remove them?
April 3rd 20 at 17:24
1 answer
April 3rd 20 at 17:26
Solution
https://tech.yandex.ru/maps/jsbox/2.1?from=jsapi

as you noticed first, create a label object, then adds it
//Global context
var myMap,myPlacemark;
// context map
myMap = new ymaps.Map(...);
//context clicking 1
myPlacemark = new ymaps.Placemark([lat, lon],{...});
myMap.geoObjects.add(myPlacemark);
//the context of pressing 2
myMap.geoObjects.remove(myPlacemark);

to execute code at an arbitrary time in an arbitrary context variable myMap should be globally accessible. But if the deletion occurs from an arbitrary context and myPlacemark should be available globally.
Thank you, I needed the add and remove methods, everything works fine) - Lilian.Stroman commented on April 3rd 20 at 17:29

Find more questions by tags Yandex.Maps