Answer the question
In order to leave comments, you need to log in
Why is it not possible to add multiple collections to ymaps.GeoObjectCollection?
There is a problem: only the last recorded collection is shown on the map.
ymaps.ready(init);
var myMap;
function init() {
myMap = new ymaps.Map("map", {
center: [53.901, 27.5601],
zoom: 11,
behaviors: ['default', 'scrollZoom']
});
myMap.controls.add('typeSelector');
myMap.controls.add('zoomControl');
myMap.controls.add('searchControl');
var geoObjects = new ymaps.GeoObjectCollection();
geoObjects.add(GetMetalPoints());
geoObjects.add(GetLightPoints());
myMap.geoObjects.add(geoObjects);
}
Answer the question
In order to leave comments, you need to log in
Hello!
just try
...
myMap.controls.add('typeSelector');
myMap.controls.add('zoomControl');
myMap.controls.add('searchControl');
myMap.geoObjects.add(GetMetalPoints());
myMap.geoObjects.add(GetLightPoints());
...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question