Z
Z
zlodiak2018-10-23 02:29:41
JavaScript
zlodiak, 2018-10-23 02:29:41

How to change marker size?

There is a marker, I would like to change its size (increase). Please help, here is my attempt:
JSFIDDLE

let map;
  
    
ymaps.ready().then(() => {
  map = new ymaps.Map('map', {
    center: [51.8005930, 12.2119510],
    zoom: 15
  });

  const marker = new ymaps.Placemark([51.8005930, 12.2119510], {}, {
    preset: 'islands#blueHomeIcon',
    iconImageSize: [268, 268]
  });

  map.geoObjects.add(marker);
});

It is important for me to use the standard icon for the marker, and not a custom image

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dies Irae, 2018-10-23
@zlodiak

Label-preset - no way.
You will have to use either a CSS sprite or even your own image (bad practice).
Example from doc-ii :

var myPlacemark3 = new ymaps.Placemark([55.85, 1.0], {}, {
    iconLayout: 'default#image',
    iconImageClipRect: ,
    iconImageHref: 'images/sprite.png',
    iconImageSize: [35, 63],
    iconImageOffset: [-35, -63]
});

B
be_a_man, 2018-10-23
@be_a_man

No way. iconImageSize is a parameter for a custom label.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question