J
J
Justdemon52015-07-27 10:18:35
JavaScript
Justdemon5, 2015-07-27 10:18:35

How to make a movable Yandex.Maps marker?

ymaps.geocode('Москва Воронцовская улица 22').val(), {
    results: 1
}).then(function (res) {
        myMap.geoObjects.removeAll();

        var firstGeoObject = res.geoObjects.get(0),
            coords = firstGeoObject.geometry.getCoordinates(),
            bounds = firstGeoObject.properties.get('boundedBy');


        myMap.geoObjects.add(firstGeoObject);
        myMap.setBounds(bounds, {
            checkZoomRange: true 
        });
    });

bunlCeG.png
After doing this, a mark is placed over the desired object, but how can this marker be moved with the mouse?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yuri, 2015-07-27
@Justdemon5

There is an example in the map sandbox .
Just add draggable: trueto marker properties

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question