Answer the question
In order to leave comments, you need to log in
Why are some functions defined as undefined in the Yandex.Maps API?
Hello.
Created a map based on Yandex.API, everything worked perfectly and correctly. There was a need to create a curve on it, and then oddities began. In the code below (from the point of view of the documentation, everything is fully consistent with the rules), alert will return "undefined function", although it should return "function function".
<script type="text/javascript">
var map;
function _yst(ymaps) {
ymaps.ready(function(){
alert(typeof ymaps.Polyline + ' ' + typeof ymaps.Placemark); // undefined function
map = new ymaps.Map(document.getElementById('map-wrapper'), {
// ...
});
var myGeoObject = new ymaps.Placemark([33, 34], {
balloonShadow: false
}, {
// ...
});
map.geoObjects.add(myGeoObject);
});
}
</script>
<script src="http://api-maps.yandex.ru/2.0-stable/?load=package.standard&lang=ru-RU&onload=_yst" type="text/javascript"></script>
Answer the question
In order to leave comments, you need to log in
There is no Polyline in the "standard" package, connect the required package or "full"
Packages
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question