Answer the question
In order to leave comments, you need to log in
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:
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>
Answer the question
In order to leave comments, you need to log in
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"});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question