SHARE
TWEET

Untitled

a guest Jun 18th, 2019 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Расчет стоимости поездки</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <style>
  7.  
  8. html, body, #map {
  9. width: 100%;
  10. height: 100%;
  11. padding: 0;
  12. margin: 0;
  13. }");
  14. </style>
  15. <script src="http://api-maps.yandex.ru/2.1/?load=package.full&lang=ru-RU&apikey=fa5d9fad-bc04-4541-9c45-7cec58e2ceac" type="text/javascript"></script>
  16. <script type="text/javascript">
  17.  
  18.  ymaps.ready(init);
  19.  function init() {
  20.  var myMap = new ymaps.Map('map', {
  21.  center: [54.901383, 52.297113],
  22.  zoom: 12.1,
  23.  yandexMapDisablePoiInteractivity: true,
  24.  controls: []
  25.  },
  26.  {
  27.  yandexMapDisablePoiInteractivity: true,
  28.  suppressMapOpenBlock: true,
  29.  }
  30.  
  31.  );
  32.  myMap.behaviors.disable('ruler');
  33.  myMap.behaviors.disable('scrollZoom');
  34. myMap.behaviors.disable('multiTouch');
  35.  myMap.behaviors.disable('drag');
  36.  myMap.behaviors.disable('dblClickZoom');
  37.  
  38.  var multiRoute = new ymaps.multiRouter.MultiRoute({
  39.  referencePoints: [
  40.  ' Откуда ',
  41.  ' Куда '
  42.  ],
  43.  params: {
  44.  results: 1
  45.  }
  46.  }, {
  47.  boundsAutoApply: true,
  48.  // routeOpenBalloonOnClick: false
  49.  });
  50.  myMap.geoObjects.add(multiRoute);
  51.  
  52.  multiRoute.getWayPoints().events.add('click', function (e) {
  53.  e.stopImmediatePropagation();
  54.  }, null, 1);
  55.  
  56.  var BoxDist = document.getElementById('dist');
  57.  ymaps.route([
  58.  ' Откуда ',
  59.  {
  60.  type: 'viaPoint',
  61.  point: ' Куда '
  62.  }
  63.  ]).then(
  64.  function (route) {
  65.  BoxDist.innerHTML = route.getLength();
  66.  },
  67.  function (error) {
  68.  BoxDist.innerHTML = 'Возникла ошибка: ' + error.message;
  69.  }
  70.  );
  71.  }
  72. </script>
  73. </head>
  74. <body>
  75. <div id="map"></div>
  76. <div id="time"></div>
  77. <div id="dist" style="display:none"></div>
  78. </body>
  79. </html>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top