S
S
Sergey Alpeev2014-08-28 15:25:22
JavaScript
Sergey Alpeev, 2014-08-28 15:25:22

How to change the balloon on the Yandex map?

Good afternoon, there is such a design

function init() {
                        var myMap = new ymaps.Map('map', {
                                center: [55.555555, 37.788628],
                                zoom: 9,
                                behaviors: ['default', 'scrollZoom']
                            });
                        
                        var massive_adres = $('.coords');
                        
                    
                       
                        massive_adres.each(function(i){
                            var objects = ymaps.geoQuery(ymaps.geocode($(this).text()))
                    
                            .addToMap(myMap); 
                        });
                       
                      
                        
                       
                    }
                    
                    ymaps.ready(init);
                        
                    });

How can I change the balloon to my picture here? I didn’t understand a little how to apply examples from the docks here

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey Alpeev, 2014-08-29
@QTnub

in general, no one helped me and did not explain, I spent a day and figured it out myself, if someone is interested, it is for such a construction that it is necessary to use the setOptions method of the geoQueryResult object api.yandex.ru/maps/doc/jsapi/2.1-dev/ ref/reference...
and here's what needs to be added exactly to this construction to make it work
.setOptions({
iconLayout: 'default#image',
iconImageHref: 'main/red_marker.png',
iconImageSize: [20, 35],
iconImageOffset: [-3, -42],
balloonContentHeader: 'Test title',
balloonContentBody: 'Test Content '
})

Y
Yuri Lobanov, 2014-08-28
@iiil

And what exactly do you not understand?

E
Evgeny Petrov, 2014-08-28
@Petroveg

How to asynchronously change the picture of a marker on Yandex maps?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question