D
D
Denis Bukreev2016-07-18 18:12:39
JavaScript
Denis Bukreev, 2016-07-18 18:12:39

Error when changing icons in the Yandex.Maps constructor, how to avoid?

I'm trying to replace the icon, I'm doing it according to the instructions .
An error is thrown:
aaaf192ca85a4c8fa47eaa19725f3a0b.png
The code is like this (in the header):

<script>
        window.onload = function () {        
            var mapI = new YMaps.Style();

            mapI.iconStyle = new YMaps.IconStyle();

            mapI.iconStyle.href = "img/point-map.png";
            mapI.iconStyle.size = new YMaps.Point(18, 22);
            mapI.iconStyle.offset = new YMaps.Point(-9, -22);

            var placemark = new YMaps.Placemark(point, {style: mapI});
            map.addOverlay(placemark);
        };
</script>

He doesn't like point at 3 from the end of the line. No idea what he is responsible for and where to get
The patient himself: alucom.bookreev.com

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Manakov, 2016-07-19
@gogolor

Found similar code here . B Set Placemark Style
// Creates a placemark with a small red icon
var placemark = new YMaps.Placemark(new YMaps.GeoPoint(35, 55), {style: "default#redSmallPoint"});

F
freeExec, 2016-07-19
@freeExec

Probably it is necessary to go through all the created markers and replace their style with the newly created one.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question