Q
Q
qovalenko2017-04-10 23:16:06
JavaScript
qovalenko, 2017-04-10 23:16:06

How to get marker coordinates?

Hello!
I use the Yandex Maps API:
it is necessary for the user to enter the address, get the marker, (if necessary, move it on the map (specified the position manually)) and get the coordinates and the request itself in the JS variable (for example, country, city, street)
Here's what now I have: codepen.io/qovalenko/pen/KWOLMv
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeny Kumanin, 2017-04-11
@qovalenko

var mySearchResults = new ymaps.GeoObjectCollection(null, {
  draggable: true,
  hintContentLayout: ymaps.templateLayoutFactory.createClass('$[properties.name]')
});

mySearchResults.events.add('dragend', function(e){
  console.log(e.get('target').geometry.getCoordinates());
})

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question