ym.modules.provider.DivIcon

Overview

Represents a lightweight marker symbol that uses a simple div element instead of an image.

var myIcon = ym.divIcon({ className: 'my-div-icon' });
// Sie können zu .my-div-icon CSS-Angaben machen.

ym.marker([50.505, 30.57], { icon: myIcon }).addTo(map);  

By default there is a class with a leaflet-div-icon, which is designed as a small white square with shadow.

Initialization

Factory: ym.divIcon(options)

Parameter: options

Name Description Data type Default value
iconSize Size of the icon in pixels. Can also be set via CSS. Point  
iconAnchor The coordinates of the top of the symbol (relative to its upper left corner). The symbol is aligned so that this point is located at the geographical position of the marker. By default it is centered if its size is specified, but it can also be set in CSS with negative borders. Point  
popupAnchor The coordinates of the point from which popups are opened, relative to the icon anchor. Point  
className A user-defined class name to be assigned to the symbol. By default leaflet-div-icon. string  
html A custom HTML code to insert into the div element, empty by default. string