L
L
limpopo19922015-04-14 21:05:12
JavaScript
limpopo1992, 2015-04-14 21:05:12

How can I change the contents of the balloon that appears on the map after clicking the label, which is placed as follows?

I add a label.

geocoder.then(
    function (res) {
    	
        myMap.geoObjects.add(res.geoObjects);
        
    },
    function (err) {
        // обработка ошибки
    }
);

And it does not work to change the contents of the balloon.
res.geoObjects
As I understand it, you need to work with this, but on any attempt, the console writes that this is an object, not a function

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Zachinalov, 2015-04-14
@limpopo1992

Are you adding a label? To me, you are trying to geocode something unknown...
Use the Yandex.Maps API more carefully. Here is an example of adding a label https://tech.yandex.ru/maps/jsbox/2.1/placemark along with a balloon and a balloon separately on the next tab.

F
forgotten, 2015-04-15
@forgotten

res.geoObjects.get(0).properties.set('balloonContent', 'bla-bla');

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question