CINXE.COM
Navitel Maps
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Navitel Maps</title> <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"> <script src="navitel/main.js" type="text/javascript"></script> <link type="text/css" rel="stylesheet" href="navitel/theme/print.css" media="print" /> <script type="text/javascript"> var urlParams = Navitel.Uri.getQueryArgs(); NMaps.setLang(urlParams.hl); NMaps.setTheme(urlParams.theme); </script> <script type="text/javascript"> /* head commit b321271d6dc0c5406e6a1deb7683e739bd39a2c2 */ function init() { // check actually page loaded var mapWidth = parseInt(document.getElementById('map').offsetWidth) if (!mapWidth || isNaN(mapWidth)) { window.setTimeout(arguments.callee, 10); return; } var urlParams = Navitel.Uri.getQueryArgs(); // 锌褉械写蟹邪谐褉褍蟹芯褔薪褘械 芯锌褑懈懈 var options = { } options.clickOptions = { handleRightClicks: true } // 懈薪懈褑懈邪谢懈蟹邪褑懈褟 泻邪褉褌褘 window.nmap = new Navitel.Map('map', options); // 写芯斜邪胁谢械薪懈械 褝谢械屑械薪褌芯胁 褍锌褉邪胁谢械薪懈褟 nmap.addControl(new NMaps.Control.Navigation({ 'dragPanOptions': {'enableKinetic': { 'nbPoints': 40, 'maxSpeed': 5 }} })); nmap.addControl(new NMaps.Control.Permalink()); nmap.addControl(new NMaps.Control.NavitelScaleLine()); nmap.addControl(new NMaps.Control.KeyboardDefaults()); //写芯斜邪胁谢械薪懈械 屑邪褉泻械褉邪 褔械褉械蟹 锌邪褉邪屑械褌褉褘 URL (褉邪斜芯褌邪械褌 褌芯谢褜泻芯 胁 iframe 胁械褉褋懈懈) if (urlParams.marker) { // marker: [0] - lon, [1] - lat, @TODO: [2] - resreved for name/title, [3] - advanced info var markersLayer = new OpenLayers.Layer.Markers(OpenLayers.i18n('markers')); nmap.addLayer(markersLayer); // 褋芯蟹写邪薪懈械 屑邪褉泻械褉邪 var ll = (new OpenLayers.LonLat(urlParams.marker[0], urlParams.marker[1])).transform(nmap.displayProjection, nmap.projection); var marker = new OpenLayers.Marker(ll); // TODO 写芯斜邪胁谢械薪懈械 薪械芯斜褟蟹邪褌械谢褜薪芯泄 胁褋锌谢褘胁邪褞褖械泄 懈薪褎芯褉屑邪褑懈懈 锌芯 薪邪胁械写械薪懈褞 懈谢懈 泻谢懈泻褍 薪邪 屑邪褉泻械褉 // 写芯斜邪胁谢械薪懈械 屑邪褉泻械褉邪 泻 泻邪褉褌械 markersLayer.addMarker(marker); } nmap.addControl(new NMaps.ToolBar({ components: ['jams', 'panmover', 'zoomin', 'zoomout'] })); } // end if init function </script> <style type="text/css"> html, body { margin: 0; padding: 0; border: 0; height: 100%; } </style> </head> <body onload="init()" class="NMaps"> <div id="map"></div> </body> </html>