A
A
Alexey Nikolaev2014-11-26 00:42:10
API
Alexey Nikolaev, 2014-11-26 00:42:10

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>

Accordingly, an attempt to create a line ends with an error about a non-existent method. I don't know where to dig - after all, a map and a label are being created. I would be grateful for advice, thanks.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeny Kumanin, 2014-11-26
@Heian

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 question

Ask a Question

731 491 924 answers to any question