L
L
Leonid Razumov2013-05-24 14:45:46
API
Leonid Razumov, 2013-05-24 14:45:46

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

2 answer(s)
V
VeMax, 2013-05-24
@JackFrost

http://clubs.ya.ru/mapsapi/replies.xml?parent_id=29567&item_no=29566&with_parent=1#reply-mapsapi-29567 ok?

L
Leonid Razumov, 2013-05-27
@JackFrost

//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 question

Ask a Question

731 491 924 answers to any question