Version:
Popular examples
Map
Geo objects
Balloon and hint
Controls
Hotspots
Clustering
GeoQuery
Behaviors and events
Search on a map
Traffic
User's location
Routing
YMapsML
GeoXML
ObjectManager
Modular system
Panoramas
External modules

Defining placemark images using CSS sprites

Save as filesEdit on JSFiddle

You can define placemark images using CSS sprites.

In order to set the desired image from a sprite as the placemark icon, this placemark must have the following options set:

  • iconImageCliptRect — the position of the desired image in the sprite. It is defined by the pixel coordinates of the upper-left and lower-right corners of the rectangle the image is placed in.
  • iconImageHref — URL of the sprite.
  • iconImageSize — Icon size.
  • iconImageOffset — Offset of the icon relative to the anchor point of the object.
  • iconLayout — The icon layout. This option must have the 'default#image' value set.

For more information about using sprites, see the documentation.

Пишете на JavaScript? У нас есть вакансии
Mon Oct 31 2022 13:07:35 GMT+0300 (Moscow Standard Time)