Клуб API Карт

Route sample doesn't work

hola.zollil
11 февраля 2015, 09:34

Hi everyone,

I want to find a route between two points on Istanbul. For this, I try to run a simple code that taken from.this guide But this code doesn't work. I can't view a route path or map. My code is here.

 

   
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
    <title>Quick start. Publishing an interactive map on a page</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script src="http://api-maps.yandex.ru/2.0-stable/?load=package.standard&lang=ru-RU" type="text/javascript"></script>
    <script src="http://yandex.st/jquery/1.6.4/jquery.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        
var ymap;
ymaps.ready(function(){ 
ymap = new ymaps.Map ("map", {
center: [41.01771, 28.968484],
zoom: 10,
controls: ['zoomControl', 'typeSelector',
  'geolocationControl', 'trafficControl',
  'fullscreenControl'] 
});
ymaps.route([
'Maltepe',
'Kartal'
]).then(function (route){
ymap.geoObjects.add(route);
}, function(error){
  alert("Ошибка. " + error.status +
":" + error.message);
}
);
});
    </script>

</head>

<body>
    <div id="mapId" style="width: 800px; height: 500px"></div>
</body>

</html>