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

Custom layout for the zoom control

Save as filesEdit on JSFiddle

Layouts of objects can be created using the templateLayoutFactory factory and text templates.

This example creates a custom layout for the map zoom control. The layout of the control is based on its data, status, and options. The layout is automatically rebuilt when changes are made to the values of fields, states, or options that are used in its text template.

In response to a user action (a mouse click on the button), the layout can generate special events that are defined in its interface. The control listens to these events on the layout and tries to change its state, data, or options. After the control has implemented changes, the layout is rebuilt based on the updated data.

The events that the zoom slider responds to are listed in the IZoomControlLayout interface.