Answer the question
In order to leave comments, you need to log in
Yandex map API 2.0. Error when using "Metro.Closest"
in the 1st version of the maps, I used the search for nearby subways like this:
var geoMetro = new YMaps.Metro.Closest(geoResult.getGeoPoint().toString(), { results : 3 } );
in the 2nd version, the browser swears:
Uncaught TypeError: Cannot read property 'Closest' of undefined
what is the right way?
Answer the question
In order to leave comments, you need to log in
http://clubs.ya.ru/mapsapi/replies.xml?parent_id=29567&item_no=29566&with_parent=1#reply-mapsapi-29567 ok?
//where are my tags...
ymaps.geocode(coords, {
kind: 'metro'
}).then(function(res) {
if (res.geoObjects.getLength()) {
var m0 = res.geoObjects.get(0 );
var m0_coords = m0.geometry.getCoordinates();
dist0 = ymaps.coordSystem.geo.getDistance(coords, m0_coords);
dist = ymaps.formatter.distance(dist0);
console.info(dist);
}
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question