JSFiddle - React, Tailwind, and code Playground
by flash11
HTML
<script src="http://api-maps.yandex.ru/2.0-stable/?lang=ru-RU&load=package.full&wizard=constructor&onload=fid_13889191"></script>
<script src="http://api-maps.yandex.ru/2.0-stable/?load=package.standard&lang=ru-RU" type="text/javascript"></script>
<div id="map"></div>
<div id="debug"></div>
CSS
#map {
width: 500px;
height: 500px;
}
#debug {
width: 400px;
border: solid 1px black;
}
JavaScript
function debug(v){
$("#debug").append(typeof(v)+': '+v+'<br/>');
}
console.log(ymaps);
var map = new ymaps.Map ("map", {
center: [55.76, 37.64],
zoom: 7
});
//first placemark
var pm = new ymaps.Placemark([55.76, 37.64]);
collection = new ymaps.GeoObjectArray();
collection.add(pm, 99);
debug('collection length: '+collection.getLength());
debug('item with index 99: '+collection.get(99));
debug('index of pm: '+collection.indexOf(pm));
//second placemark
var pm2 = new ymaps.Placemark([55.762, 37.642]);
collection.add(pm2, 101);
debug('collection length: '+collection.getLength());
debug('item with index 101: '+collection.get(101));
debug('index of pm: '+collection.indexOf(pm2));