UNPKG

2gis-maps

Version:

Interactive 2GIS maps API, based on Leaflet

46 lines (40 loc) 1.48 kB
<!DOCTYPE html> <html> <head> <meta charset='utf-8'> <title>DG.then demo</title> <script src="http://maps.api.2gis.ru/2.0/loader.js"></script> </head> <body> <div id="map" style="width: 100%; height: 600px; border: 1px solid #ccc;"></div> <script type="text/javascript"> var map, balloonHTML; DG.then(function () { map = new DG.Map('map', { center: new DG.LatLng(54.980206086231, 82.898068362003), zoom: 15, dgGeoclicker: true }); balloonHTML = '<a href="http://www.2gis.ru/" target="_blank">\n\ <img src="2gis-logo.png" alt="2GIS" title="2GIS" width="146" height="70" style="border: none"></a>\n\ <p>Компания «ДубльГИС»</p>Тел.: (383) 363-05-55<br />Адрес: г. Новосибирск, Карла Маркса площадь, 7<br />\n\ (МФК «Сан Сити»), 13 этаж'; DG.marker([54.980206086231, 82.898068362003]).addTo(map).bindPopup(balloonHTML).openPopup(); }).then(function () { console.log('second handler'); }).then(function () { setTimeout(function (argument) { console.log('still works'); }, 2000) }); setTimeout(function (argument) { DG.then(function(){ console.log('deffered handler'); }).then(function () { console.log('another one'); }) }, 4000) </script> </body> </html>