O
O
ocatoll2016-07-29 16:16:33
JavaScript
ocatoll, 2016-07-29 16:16:33

Why does the custom label shift when zoomed in Yandex Maps?

The problem is that when using a custom label like so

company_adress = new ymaps.Placemark([xxx,xxx], {  }, {
        iconLayout: 'default#image',
        iconImageHref: '/marker.png',
        iconImageSize: [64, 96],        
        iconImageOffset: [-32, 0],
    });

I get a problem: when the map is scaled, the label shifts, respectively, the more the scale changes, the greater the discrepancy between the real coordinates and the position of the label on the map. At the same time, this is not observed with default icons.
Actually, even in the example, Yandex has this problem https://tech.yandex.ru/maps/jsbox/2.1/
Therefore, the question is, is it possible to somehow overcome the offset when scaling so that the label always remains where it should be?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
forgotten, 2016-07-29
@ocatoll

Offset is set incorrectly.
Let's fix the example, thanks.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question