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

Using the dragger

Save as filesEdit on JSFiddle

In this example, the dragger is used for dragging the "#marker" HTML element. This HTML element was passed as the value of the autoStartElement option. The dragger is automatically started on the mousedown event of the autoStartElement. It is possible to initialize the dragger manually using the start() method. The dragger stops on the mouseup event of the document, but it is possible to terminate the dragger earlier using the stop() method.

All dragger events contain the fields 'position' and 'delta', which tell us the current cursor position and the offset of the current position relative to the last dragger event. In the example, when the stop event occurs, the marker position is converted to geocoordinates if the dragger has stopped working on the map.

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