J
J
JohnDaniels2016-07-26 18:49:42
Yandex maps
JohnDaniels, 2016-07-26 18:49:42

Why does the label style on the Yandex map not change?

I do it like this:

ymaps.ready(init);
    var myMap;

    function init(){     
        myMap = new ymaps.Map ("map", {
            center: [55.76, 37.64],
            zoom: 4,
        });
        
        myMap.behaviors
            .disable(['rightMouseButtonMagnifier'])
            .enable('drag', 'zoom');
    
        var myPlacemark = new ymaps.Placemark(
           [ymaps.geolocation.latitude, ymaps.geolocation.longitude], 
           {iconContent: 'Вы здесь'},
           {preset: 'islands#redIcon'}
        );
        
        myMap.geoObjects.add(myPlacemark);
    }

but still getting the standard blue badge
a80f32bb5db543dabe6793ee4afa10b7.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
forgotten, 2016-07-26
@JohnDaniels

You have part of the code for API 2.0, part from 2.1. Judging by the fact that your label is drawn, 2.0 is connected. Then you need to change the islands# prefix to twirl#

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question