Quantcast
Channel: Клуб API Карт
Viewing all articles
Browse latest Browse all 7380

как обработать ошибку не правильно веденного города?

$
0
0

пишу 

function prover(gorod1) {

    var myMap = new ymaps.Map("map", {

            center: [55.745508, 37.435225],

            zoom: 13

        });

 

 

var myGeocoder = ymaps.geocode(gorod1);

myGeocoder.then(

    function (res) {

       // map.geoObjects.add(res.geoObjects);

    },

    function (err) {

        alert("ошибка")

    }

);

 

}

 

и он в любом случии выполняет алерт 

.

Viewing all articles
Browse latest Browse all 7380

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>