yandex-maps

Yandex Maps Api - How can I change location the placemark?


How can I change location placemark on Yandex maps?

I added placemark and need change to location with javascript.

I've tried:

var LatLng = [ 22.2222, 33.3333 ];
myPlacemark.setPosition(LatLng);

but it is not working.


Solution

  • According to the API documentation the method name is setCoordinates and it's applied to the geometry of the placemark, so the following should work:

    myPlacemark.geometry.setCoordinates(LatLng)