Answer the question
In order to leave comments, you need to log in
How to resolve conflict between yandex api 2.0 2.1 versions?
Good afternoon!
The site has two functions using yandex.api, these are:
1. User identification on the map;
2. Determining the user's city, and subsequently displaying the city on the page.
Separately, they work fine (
An example is here.
If you remove the commented code, the definition of the city immediately breaks down.
I can’t understand what the conflict is, I ask for help. Thank you in advance!
Answer the question
In order to leave comments, you need to log in
Determining the location of the city Yandex API 2.1
ymaps.ready(init);
function init(){
ymaps.geolocation.get({
provider: 'yandex',
autoReverseGeocode: true
}).then(function (result) {
$('#tow').html('Ваш город: <b style="margin-top: -50px;">'+result.geoObjects.get(0).properties.get('metaDataProperty.GeocoderMetaData.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality.LocalityName')+'</b>'); //Определяем ваш город
});
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question