本日は、Nokia Maps JS APIを使用してWebサイトでNokiaマップを使用する方法を説明します。 Nokia Mapsサービスには、非常に使いやすいAPIだけでなく、地理オブジェクトの膨大なベースを備えた優れたマップ詳細があり、これは常に更新されます。
Nokia Developers 2012でのSergei Rudenkoのプレゼンテーション( リンク )から、Nokia Mapsの技術的機能の詳細を学ぶことができます。マップ統合の例を使用して、Nokia Maps JS APIを使用し、ジオロケーションおよびルートプランニング機能を使用する可能性のいくつかについて説明し始めます。 次のようになります。
まず、div#mapContainerコンテナーを使用して単純なhtmlページを作成し、その中にマップを配置し、プリミティブスタイルシートを作成します。
<html> <head> <meta charset="utf-8"> <title>Nokia Maps JS API</title> <style type="text/css"> * {margin: 0;padding: 0} html {overflow:hidden;} body {margin:0;padding:0;overflow:hidden;width:100%;height:100%;position:absolute;} #mapContainer {width:100%;height:100%;left:0;top:0;position: absolute;z-index:1;} </style> </head> <body> <div id="mapContainer"> </div> </body> </html>
互換性を忘れないでください。モバイルブラウザのサポートを改善するために、ヘッダーにメタ情報を追加してください。
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=yes" />
次の行を追加して、Nokia Maps JS APIを接続します。
<script type="text/javascript" charset="UTF-8" src="http://api.maps.nokia.com/2.2.1/jsl.js?with=all"></script>
これは、マップ、場所(POI)、場所、ルーティング、データレンダリング(ヒートマップの操作など)をサポートするための個別のパッケージを含むモジュラーAPIであることに留意してください。 ライブラリをすべてのパッケージをダウンロードするためにWith = allパラメーターで接続しましたが、すべてを必要としない場合は、作業後に必要なモジュールのみをリストすることでそれらを除外できますか?With =、たとえば:
<script type="text/javascript" src="http://api.maps.nokia.com/2.2.1/jsl.js?with=maps,places,directions,positioning"></script>
これにより、スクリプトのロード時間が短縮されるため、作業中のプロジェクトでは必要なモジュールのみを使用してください。 すべてのモジュールのリストはここにあります 。
に追加してマップを初期化しましょう
javascript:
nokia.Settings.set("appId", "_peU-uCkp-j8ovkzFGNU"); nokia.Settings.set("authenticationToken", "gBoUkAMoxoqIWfxWA5DuMQ"); // . nokia.Settings.set("defaultLanguage", "ru-RU"); // DOM-, Nokia var mapContainer = document.getElementById("mapContainer"); // mapContainer // DOM- var map = new nokia.maps.map.Display(mapContainer, { // , , center: [55.752316, 37.614188], // zoomLevel: 10, components: [ // // ZoomBar new nokia.maps.map.component.ZoomBar(), // Behavior new nokia.maps.map.component.Behavior(), // TypeSelector ( , , ) new nokia.maps.map.component.TypeSelector(), // Traffic / new nokia.maps.map.component.Traffic(), // PublicTransport / new nokia.maps.map.component.PublicTransport(), // Overview - new nokia.maps.map.component.Overview(), // ScaleBar new nokia.maps.map.component.ScaleBar(), // Positioning new nokia.maps.positioning.component.Positioning(), // ContextMenu new nokia.maps.map.component.ContextMenu() ] });
, . , , , , . , . Wi-Fi, — GPS . :
if (nokia.maps.positioning.Manager) { var positioning = new nokia.maps.positioning.Manager(); positioning.getCurrentPosition( function (position) { window.coords = position.coords, // marker = new nokia.maps.map.StandardMarker(coords), // // , accuracyCircle = new nokia.maps.map.Circle(coords, coords.accuracy); // map.objects.addAll([accuracyCircle, marker]); // , map.zoomTo(accuracyCircle.getBoundingBox(), false, "default"); }, // - GPS function (error) { var errorMsg = " : "; // if (error.code == 1) errorMsg += " "; else if (error.code == 2) errorMsg += " "; else if (error.code == 3) errorMsg += ""; else errorMsg += " "; // alert(errorMsg); } ); }
, Nokia :
// Nokia ( 10, ) var nokia_marker = new nokia.maps.map.Marker( new nokia.maps.geo.Coordinate(55.753105, 37.605858),{ title: "Nokia office", visibility: true, icon: "http://habrastorage.org/storage2/772/09f/d91/77209fd919c23f77c10ff6451f1746d0.png", // ( 48 48 ) anchor: new nokia.maps.util.Point(24, 24) }); // map.objects.add(nokia_marker);
, . Nokia , :
var onRouteCalculated = function (observedRouter, key, value) { if (value == "finished") { var routes = observedRouter.getRoutes(); // var mapRoute = new nokia.maps.routing.component.RouteResultSet(routes[0]).container; map.objects.add(mapRoute); // map.zoomTo(mapRoute.getBoundingBox(), false, "default"); } else if (value == "failed") { alert("The routing request failed."); } }; // 'state' , onRouteCalculated , router.addObserver("state", onRouteCalculated); // var waypoints = new nokia.maps.routing.WaypointParameterList(); waypoints.addCoordinate(new nokia.maps.geo.Coordinate(55.753105, 37.605858)); waypoints.addCoordinate(new nokia.maps.geo.Coordinate(55.752316, 37.614188)); /* , transportModes, RoutingOptions trafficMode / http://api.maps.nokia.com/en/apireference/2.2.1/symbols/nokia.maps.routing.Mode.html */ var modes = [{ type: "shortest", transportModes: ["car"], options: "avoidTollroad", trafficMode: "default" }];
, . router.calculateRoute(waypoints, modes);
, .
Nokia: , , , .
:
<div id="helperContainer"> <ul> <li><a id="u_r_here" href="#"> </a></li> <li><a id="nokia_office" href="#"> Nokia </a></li> <li><a id="kremlin" href="#"> Nokia </a></li> </ul> </div>
, :
#helperContainer {z-index:100;display: inline-block;position: absolute;width: auto;height: auto;border-radius: 5px;background-color: rgba(0,0,0,0.8);top:8px;left: 40px;} ul {list-style-type: none;} li {display:inline-block; padding:3 5px;} li a {color:#fff;text-decoration: none;font: 12px/12px "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;}
: :
// $('#u_r_here').bind('click', function(e){ e.preventDefault() // map.set("center", coords); map.zoomTo(accuracyCircle.getBoundingBox(), false, "default"); }); $('#nokia_office').bind('click', function(e){ e.preventDefault() // Nokia map.set("center", [55.753105, 37.605858]); map.set("zoomLevel", 16); }); $('#kremlin').bind('click', function(e){ e.preventDefault() // Nokia . — %) router.calculateRoute(waypoints, modes); });
, , , github:gist .
Nokia Maps JS API , , . . API JavaScript , Qt Java ME .
RESTful- Nokia Maps Nokia Places Points of Interests ( ).
javascript:
nokia.Settings.set("appId", "_peU-uCkp-j8ovkzFGNU"); nokia.Settings.set("authenticationToken", "gBoUkAMoxoqIWfxWA5DuMQ"); // . nokia.Settings.set("defaultLanguage", "ru-RU"); // DOM-, Nokia var mapContainer = document.getElementById("mapContainer"); // mapContainer // DOM- var map = new nokia.maps.map.Display(mapContainer, { // , , center: [55.752316, 37.614188], // zoomLevel: 10, components: [ // // ZoomBar new nokia.maps.map.component.ZoomBar(), // Behavior new nokia.maps.map.component.Behavior(), // TypeSelector ( , , ) new nokia.maps.map.component.TypeSelector(), // Traffic / new nokia.maps.map.component.Traffic(), // PublicTransport / new nokia.maps.map.component.PublicTransport(), // Overview - new nokia.maps.map.component.Overview(), // ScaleBar new nokia.maps.map.component.ScaleBar(), // Positioning new nokia.maps.positioning.component.Positioning(), // ContextMenu new nokia.maps.map.component.ContextMenu() ] });
, . , , , , . , . Wi-Fi, — GPS . :
if (nokia.maps.positioning.Manager) { var positioning = new nokia.maps.positioning.Manager(); positioning.getCurrentPosition( function (position) { window.coords = position.coords, // marker = new nokia.maps.map.StandardMarker(coords), // // , accuracyCircle = new nokia.maps.map.Circle(coords, coords.accuracy); // map.objects.addAll([accuracyCircle, marker]); // , map.zoomTo(accuracyCircle.getBoundingBox(), false, "default"); }, // - GPS function (error) { var errorMsg = " : "; // if (error.code == 1) errorMsg += " "; else if (error.code == 2) errorMsg += " "; else if (error.code == 3) errorMsg += ""; else errorMsg += " "; // alert(errorMsg); } ); }
, Nokia :
// Nokia ( 10, ) var nokia_marker = new nokia.maps.map.Marker( new nokia.maps.geo.Coordinate(55.753105, 37.605858),{ title: "Nokia office", visibility: true, icon: "http://habrastorage.org/storage2/772/09f/d91/77209fd919c23f77c10ff6451f1746d0.png", // ( 48 48 ) anchor: new nokia.maps.util.Point(24, 24) }); // map.objects.add(nokia_marker);
, . Nokia , :
var onRouteCalculated = function (observedRouter, key, value) { if (value == "finished") { var routes = observedRouter.getRoutes(); // var mapRoute = new nokia.maps.routing.component.RouteResultSet(routes[0]).container; map.objects.add(mapRoute); // map.zoomTo(mapRoute.getBoundingBox(), false, "default"); } else if (value == "failed") { alert("The routing request failed."); } }; // 'state' , onRouteCalculated , router.addObserver("state", onRouteCalculated); // var waypoints = new nokia.maps.routing.WaypointParameterList(); waypoints.addCoordinate(new nokia.maps.geo.Coordinate(55.753105, 37.605858)); waypoints.addCoordinate(new nokia.maps.geo.Coordinate(55.752316, 37.614188)); /* , transportModes, RoutingOptions trafficMode / http://api.maps.nokia.com/en/apireference/2.2.1/symbols/nokia.maps.routing.Mode.html */ var modes = [{ type: "shortest", transportModes: ["car"], options: "avoidTollroad", trafficMode: "default" }];
, . router.calculateRoute(waypoints, modes);
, .
Nokia: , , , .
:
<div id="helperContainer"> <ul> <li><a id="u_r_here" href="#"> </a></li> <li><a id="nokia_office" href="#"> Nokia </a></li> <li><a id="kremlin" href="#"> Nokia </a></li> </ul> </div>
, :
#helperContainer {z-index:100;display: inline-block;position: absolute;width: auto;height: auto;border-radius: 5px;background-color: rgba(0,0,0,0.8);top:8px;left: 40px;} ul {list-style-type: none;} li {display:inline-block; padding:3 5px;} li a {color:#fff;text-decoration: none;font: 12px/12px "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;}
: :
// $('#u_r_here').bind('click', function(e){ e.preventDefault() // map.set("center", coords); map.zoomTo(accuracyCircle.getBoundingBox(), false, "default"); }); $('#nokia_office').bind('click', function(e){ e.preventDefault() // Nokia map.set("center", [55.753105, 37.605858]); map.set("zoomLevel", 16); }); $('#kremlin').bind('click', function(e){ e.preventDefault() // Nokia . — %) router.calculateRoute(waypoints, modes); });
, , , github:gist .
Nokia Maps JS API , , . . API JavaScript , Qt Java ME .
RESTful- Nokia Maps Nokia Places Points of Interests ( ).
javascript:
nokia.Settings.set("appId", "_peU-uCkp-j8ovkzFGNU"); nokia.Settings.set("authenticationToken", "gBoUkAMoxoqIWfxWA5DuMQ"); // . nokia.Settings.set("defaultLanguage", "ru-RU"); // DOM-, Nokia var mapContainer = document.getElementById("mapContainer"); // mapContainer // DOM- var map = new nokia.maps.map.Display(mapContainer, { // , , center: [55.752316, 37.614188], // zoomLevel: 10, components: [ // // ZoomBar new nokia.maps.map.component.ZoomBar(), // Behavior new nokia.maps.map.component.Behavior(), // TypeSelector ( , , ) new nokia.maps.map.component.TypeSelector(), // Traffic / new nokia.maps.map.component.Traffic(), // PublicTransport / new nokia.maps.map.component.PublicTransport(), // Overview - new nokia.maps.map.component.Overview(), // ScaleBar new nokia.maps.map.component.ScaleBar(), // Positioning new nokia.maps.positioning.component.Positioning(), // ContextMenu new nokia.maps.map.component.ContextMenu() ] });
, . , , , , . , . Wi-Fi, — GPS . :
if (nokia.maps.positioning.Manager) { var positioning = new nokia.maps.positioning.Manager(); positioning.getCurrentPosition( function (position) { window.coords = position.coords, // marker = new nokia.maps.map.StandardMarker(coords), // // , accuracyCircle = new nokia.maps.map.Circle(coords, coords.accuracy); // map.objects.addAll([accuracyCircle, marker]); // , map.zoomTo(accuracyCircle.getBoundingBox(), false, "default"); }, // - GPS function (error) { var errorMsg = " : "; // if (error.code == 1) errorMsg += " "; else if (error.code == 2) errorMsg += " "; else if (error.code == 3) errorMsg += ""; else errorMsg += " "; // alert(errorMsg); } ); }
, Nokia :
// Nokia ( 10, ) var nokia_marker = new nokia.maps.map.Marker( new nokia.maps.geo.Coordinate(55.753105, 37.605858),{ title: "Nokia office", visibility: true, icon: "http://habrastorage.org/storage2/772/09f/d91/77209fd919c23f77c10ff6451f1746d0.png", // ( 48 48 ) anchor: new nokia.maps.util.Point(24, 24) }); // map.objects.add(nokia_marker);
, . Nokia , :
var onRouteCalculated = function (observedRouter, key, value) { if (value == "finished") { var routes = observedRouter.getRoutes(); // var mapRoute = new nokia.maps.routing.component.RouteResultSet(routes[0]).container; map.objects.add(mapRoute); // map.zoomTo(mapRoute.getBoundingBox(), false, "default"); } else if (value == "failed") { alert("The routing request failed."); } }; // 'state' , onRouteCalculated , router.addObserver("state", onRouteCalculated); // var waypoints = new nokia.maps.routing.WaypointParameterList(); waypoints.addCoordinate(new nokia.maps.geo.Coordinate(55.753105, 37.605858)); waypoints.addCoordinate(new nokia.maps.geo.Coordinate(55.752316, 37.614188)); /* , transportModes, RoutingOptions trafficMode / http://api.maps.nokia.com/en/apireference/2.2.1/symbols/nokia.maps.routing.Mode.html */ var modes = [{ type: "shortest", transportModes: ["car"], options: "avoidTollroad", trafficMode: "default" }];
, . router.calculateRoute(waypoints, modes);
, .
Nokia: , , , .
:
<div id="helperContainer"> <ul> <li><a id="u_r_here" href="#"> </a></li> <li><a id="nokia_office" href="#"> Nokia </a></li> <li><a id="kremlin" href="#"> Nokia </a></li> </ul> </div>
, :
#helperContainer {z-index:100;display: inline-block;position: absolute;width: auto;height: auto;border-radius: 5px;background-color: rgba(0,0,0,0.8);top:8px;left: 40px;} ul {list-style-type: none;} li {display:inline-block; padding:3 5px;} li a {color:#fff;text-decoration: none;font: 12px/12px "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;}
: :
// $('#u_r_here').bind('click', function(e){ e.preventDefault() // map.set("center", coords); map.zoomTo(accuracyCircle.getBoundingBox(), false, "default"); }); $('#nokia_office').bind('click', function(e){ e.preventDefault() // Nokia map.set("center", [55.753105, 37.605858]); map.set("zoomLevel", 16); }); $('#kremlin').bind('click', function(e){ e.preventDefault() // Nokia . — %) router.calculateRoute(waypoints, modes); });
, , , github:gist .
Nokia Maps JS API , , . . API JavaScript , Qt Java ME .
RESTful- Nokia Maps Nokia Places Points of Interests ( ).
javascript:
nokia.Settings.set("appId", "_peU-uCkp-j8ovkzFGNU"); nokia.Settings.set("authenticationToken", "gBoUkAMoxoqIWfxWA5DuMQ"); // . nokia.Settings.set("defaultLanguage", "ru-RU"); // DOM-, Nokia var mapContainer = document.getElementById("mapContainer"); // mapContainer // DOM- var map = new nokia.maps.map.Display(mapContainer, { // , , center: [55.752316, 37.614188], // zoomLevel: 10, components: [ // // ZoomBar new nokia.maps.map.component.ZoomBar(), // Behavior new nokia.maps.map.component.Behavior(), // TypeSelector ( , , ) new nokia.maps.map.component.TypeSelector(), // Traffic / new nokia.maps.map.component.Traffic(), // PublicTransport / new nokia.maps.map.component.PublicTransport(), // Overview - new nokia.maps.map.component.Overview(), // ScaleBar new nokia.maps.map.component.ScaleBar(), // Positioning new nokia.maps.positioning.component.Positioning(), // ContextMenu new nokia.maps.map.component.ContextMenu() ] });
, . , , , , . , . Wi-Fi, — GPS . :
if (nokia.maps.positioning.Manager) { var positioning = new nokia.maps.positioning.Manager(); positioning.getCurrentPosition( function (position) { window.coords = position.coords, // marker = new nokia.maps.map.StandardMarker(coords), // // , accuracyCircle = new nokia.maps.map.Circle(coords, coords.accuracy); // map.objects.addAll([accuracyCircle, marker]); // , map.zoomTo(accuracyCircle.getBoundingBox(), false, "default"); }, // - GPS function (error) { var errorMsg = " : "; // if (error.code == 1) errorMsg += " "; else if (error.code == 2) errorMsg += " "; else if (error.code == 3) errorMsg += ""; else errorMsg += " "; // alert(errorMsg); } ); }
, Nokia :
// Nokia ( 10, ) var nokia_marker = new nokia.maps.map.Marker( new nokia.maps.geo.Coordinate(55.753105, 37.605858),{ title: "Nokia office", visibility: true, icon: "http://habrastorage.org/storage2/772/09f/d91/77209fd919c23f77c10ff6451f1746d0.png", // ( 48 48 ) anchor: new nokia.maps.util.Point(24, 24) }); // map.objects.add(nokia_marker);
, . Nokia , :
var onRouteCalculated = function (observedRouter, key, value) { if (value == "finished") { var routes = observedRouter.getRoutes(); // var mapRoute = new nokia.maps.routing.component.RouteResultSet(routes[0]).container; map.objects.add(mapRoute); // map.zoomTo(mapRoute.getBoundingBox(), false, "default"); } else if (value == "failed") { alert("The routing request failed."); } }; // 'state' , onRouteCalculated , router.addObserver("state", onRouteCalculated); // var waypoints = new nokia.maps.routing.WaypointParameterList(); waypoints.addCoordinate(new nokia.maps.geo.Coordinate(55.753105, 37.605858)); waypoints.addCoordinate(new nokia.maps.geo.Coordinate(55.752316, 37.614188)); /* , transportModes, RoutingOptions trafficMode / http://api.maps.nokia.com/en/apireference/2.2.1/symbols/nokia.maps.routing.Mode.html */ var modes = [{ type: "shortest", transportModes: ["car"], options: "avoidTollroad", trafficMode: "default" }];
, . router.calculateRoute(waypoints, modes);
, .
Nokia: , , , .
:
<div id="helperContainer"> <ul> <li><a id="u_r_here" href="#"> </a></li> <li><a id="nokia_office" href="#"> Nokia </a></li> <li><a id="kremlin" href="#"> Nokia </a></li> </ul> </div>
, :
#helperContainer {z-index:100;display: inline-block;position: absolute;width: auto;height: auto;border-radius: 5px;background-color: rgba(0,0,0,0.8);top:8px;left: 40px;} ul {list-style-type: none;} li {display:inline-block; padding:3 5px;} li a {color:#fff;text-decoration: none;font: 12px/12px "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;}
: :
// $('#u_r_here').bind('click', function(e){ e.preventDefault() // map.set("center", coords); map.zoomTo(accuracyCircle.getBoundingBox(), false, "default"); }); $('#nokia_office').bind('click', function(e){ e.preventDefault() // Nokia map.set("center", [55.753105, 37.605858]); map.set("zoomLevel", 16); }); $('#kremlin').bind('click', function(e){ e.preventDefault() // Nokia . — %) router.calculateRoute(waypoints, modes); });
, , , github:gist .
Nokia Maps JS API , , . . API JavaScript , Qt Java ME .
RESTful- Nokia Maps Nokia Places Points of Interests ( ).
javascript:
nokia.Settings.set("appId", "_peU-uCkp-j8ovkzFGNU"); nokia.Settings.set("authenticationToken", "gBoUkAMoxoqIWfxWA5DuMQ"); // . nokia.Settings.set("defaultLanguage", "ru-RU"); // DOM-, Nokia var mapContainer = document.getElementById("mapContainer"); // mapContainer // DOM- var map = new nokia.maps.map.Display(mapContainer, { // , , center: [55.752316, 37.614188], // zoomLevel: 10, components: [ // // ZoomBar new nokia.maps.map.component.ZoomBar(), // Behavior new nokia.maps.map.component.Behavior(), // TypeSelector ( , , ) new nokia.maps.map.component.TypeSelector(), // Traffic / new nokia.maps.map.component.Traffic(), // PublicTransport / new nokia.maps.map.component.PublicTransport(), // Overview - new nokia.maps.map.component.Overview(), // ScaleBar new nokia.maps.map.component.ScaleBar(), // Positioning new nokia.maps.positioning.component.Positioning(), // ContextMenu new nokia.maps.map.component.ContextMenu() ] });
, . , , , , . , . Wi-Fi, — GPS . :
if (nokia.maps.positioning.Manager) { var positioning = new nokia.maps.positioning.Manager(); positioning.getCurrentPosition( function (position) { window.coords = position.coords, // marker = new nokia.maps.map.StandardMarker(coords), // // , accuracyCircle = new nokia.maps.map.Circle(coords, coords.accuracy); // map.objects.addAll([accuracyCircle, marker]); // , map.zoomTo(accuracyCircle.getBoundingBox(), false, "default"); }, // - GPS function (error) { var errorMsg = " : "; // if (error.code == 1) errorMsg += " "; else if (error.code == 2) errorMsg += " "; else if (error.code == 3) errorMsg += ""; else errorMsg += " "; // alert(errorMsg); } ); }
, Nokia :
// Nokia ( 10, ) var nokia_marker = new nokia.maps.map.Marker( new nokia.maps.geo.Coordinate(55.753105, 37.605858),{ title: "Nokia office", visibility: true, icon: "http://habrastorage.org/storage2/772/09f/d91/77209fd919c23f77c10ff6451f1746d0.png", // ( 48 48 ) anchor: new nokia.maps.util.Point(24, 24) }); // map.objects.add(nokia_marker);
, . Nokia , :
var onRouteCalculated = function (observedRouter, key, value) { if (value == "finished") { var routes = observedRouter.getRoutes(); // var mapRoute = new nokia.maps.routing.component.RouteResultSet(routes[0]).container; map.objects.add(mapRoute); // map.zoomTo(mapRoute.getBoundingBox(), false, "default"); } else if (value == "failed") { alert("The routing request failed."); } }; // 'state' , onRouteCalculated , router.addObserver("state", onRouteCalculated); // var waypoints = new nokia.maps.routing.WaypointParameterList(); waypoints.addCoordinate(new nokia.maps.geo.Coordinate(55.753105, 37.605858)); waypoints.addCoordinate(new nokia.maps.geo.Coordinate(55.752316, 37.614188)); /* , transportModes, RoutingOptions trafficMode / http://api.maps.nokia.com/en/apireference/2.2.1/symbols/nokia.maps.routing.Mode.html */ var modes = [{ type: "shortest", transportModes: ["car"], options: "avoidTollroad", trafficMode: "default" }];
, . router.calculateRoute(waypoints, modes);
, .
Nokia: , , , .
:
<div id="helperContainer"> <ul> <li><a id="u_r_here" href="#"> </a></li> <li><a id="nokia_office" href="#"> Nokia </a></li> <li><a id="kremlin" href="#"> Nokia </a></li> </ul> </div>
, :
#helperContainer {z-index:100;display: inline-block;position: absolute;width: auto;height: auto;border-radius: 5px;background-color: rgba(0,0,0,0.8);top:8px;left: 40px;} ul {list-style-type: none;} li {display:inline-block; padding:3 5px;} li a {color:#fff;text-decoration: none;font: 12px/12px "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;}
: :
// $('#u_r_here').bind('click', function(e){ e.preventDefault() // map.set("center", coords); map.zoomTo(accuracyCircle.getBoundingBox(), false, "default"); }); $('#nokia_office').bind('click', function(e){ e.preventDefault() // Nokia map.set("center", [55.753105, 37.605858]); map.set("zoomLevel", 16); }); $('#kremlin').bind('click', function(e){ e.preventDefault() // Nokia . — %) router.calculateRoute(waypoints, modes); });
, , , github:gist .
Nokia Maps JS API , , . . API JavaScript , Qt Java ME .
RESTful- Nokia Maps Nokia Places Points of Interests ( ).
javascript:
nokia.Settings.set("appId", "_peU-uCkp-j8ovkzFGNU"); nokia.Settings.set("authenticationToken", "gBoUkAMoxoqIWfxWA5DuMQ"); // . nokia.Settings.set("defaultLanguage", "ru-RU"); // DOM-, Nokia var mapContainer = document.getElementById("mapContainer"); // mapContainer // DOM- var map = new nokia.maps.map.Display(mapContainer, { // , , center: [55.752316, 37.614188], // zoomLevel: 10, components: [ // // ZoomBar new nokia.maps.map.component.ZoomBar(), // Behavior new nokia.maps.map.component.Behavior(), // TypeSelector ( , , ) new nokia.maps.map.component.TypeSelector(), // Traffic / new nokia.maps.map.component.Traffic(), // PublicTransport / new nokia.maps.map.component.PublicTransport(), // Overview - new nokia.maps.map.component.Overview(), // ScaleBar new nokia.maps.map.component.ScaleBar(), // Positioning new nokia.maps.positioning.component.Positioning(), // ContextMenu new nokia.maps.map.component.ContextMenu() ] });
, . , , , , . , . Wi-Fi, — GPS . :
if (nokia.maps.positioning.Manager) { var positioning = new nokia.maps.positioning.Manager(); positioning.getCurrentPosition( function (position) { window.coords = position.coords, // marker = new nokia.maps.map.StandardMarker(coords), // // , accuracyCircle = new nokia.maps.map.Circle(coords, coords.accuracy); // map.objects.addAll([accuracyCircle, marker]); // , map.zoomTo(accuracyCircle.getBoundingBox(), false, "default"); }, // - GPS function (error) { var errorMsg = " : "; // if (error.code == 1) errorMsg += " "; else if (error.code == 2) errorMsg += " "; else if (error.code == 3) errorMsg += ""; else errorMsg += " "; // alert(errorMsg); } ); }
, Nokia :
// Nokia ( 10, ) var nokia_marker = new nokia.maps.map.Marker( new nokia.maps.geo.Coordinate(55.753105, 37.605858),{ title: "Nokia office", visibility: true, icon: "http://habrastorage.org/storage2/772/09f/d91/77209fd919c23f77c10ff6451f1746d0.png", // ( 48 48 ) anchor: new nokia.maps.util.Point(24, 24) }); // map.objects.add(nokia_marker);
, . Nokia , :
var onRouteCalculated = function (observedRouter, key, value) { if (value == "finished") { var routes = observedRouter.getRoutes(); // var mapRoute = new nokia.maps.routing.component.RouteResultSet(routes[0]).container; map.objects.add(mapRoute); // map.zoomTo(mapRoute.getBoundingBox(), false, "default"); } else if (value == "failed") { alert("The routing request failed."); } }; // 'state' , onRouteCalculated , router.addObserver("state", onRouteCalculated); // var waypoints = new nokia.maps.routing.WaypointParameterList(); waypoints.addCoordinate(new nokia.maps.geo.Coordinate(55.753105, 37.605858)); waypoints.addCoordinate(new nokia.maps.geo.Coordinate(55.752316, 37.614188)); /* , transportModes, RoutingOptions trafficMode / http://api.maps.nokia.com/en/apireference/2.2.1/symbols/nokia.maps.routing.Mode.html */ var modes = [{ type: "shortest", transportModes: ["car"], options: "avoidTollroad", trafficMode: "default" }];
, . router.calculateRoute(waypoints, modes);
, .
Nokia: , , , .
:
<div id="helperContainer"> <ul> <li><a id="u_r_here" href="#"> </a></li> <li><a id="nokia_office" href="#"> Nokia </a></li> <li><a id="kremlin" href="#"> Nokia </a></li> </ul> </div>
, :
#helperContainer {z-index:100;display: inline-block;position: absolute;width: auto;height: auto;border-radius: 5px;background-color: rgba(0,0,0,0.8);top:8px;left: 40px;} ul {list-style-type: none;} li {display:inline-block; padding:3 5px;} li a {color:#fff;text-decoration: none;font: 12px/12px "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;}
: :
// $('#u_r_here').bind('click', function(e){ e.preventDefault() // map.set("center", coords); map.zoomTo(accuracyCircle.getBoundingBox(), false, "default"); }); $('#nokia_office').bind('click', function(e){ e.preventDefault() // Nokia map.set("center", [55.753105, 37.605858]); map.set("zoomLevel", 16); }); $('#kremlin').bind('click', function(e){ e.preventDefault() // Nokia . — %) router.calculateRoute(waypoints, modes); });
, , , github:gist .
Nokia Maps JS API , , . . API JavaScript , Qt Java ME .
RESTful- Nokia Maps Nokia Places Points of Interests ( ).
javascript:
nokia.Settings.set("appId", "_peU-uCkp-j8ovkzFGNU"); nokia.Settings.set("authenticationToken", "gBoUkAMoxoqIWfxWA5DuMQ"); // . nokia.Settings.set("defaultLanguage", "ru-RU"); // DOM-, Nokia var mapContainer = document.getElementById("mapContainer"); // mapContainer // DOM- var map = new nokia.maps.map.Display(mapContainer, { // , , center: [55.752316, 37.614188], // zoomLevel: 10, components: [ // // ZoomBar new nokia.maps.map.component.ZoomBar(), // Behavior new nokia.maps.map.component.Behavior(), // TypeSelector ( , , ) new nokia.maps.map.component.TypeSelector(), // Traffic / new nokia.maps.map.component.Traffic(), // PublicTransport / new nokia.maps.map.component.PublicTransport(), // Overview - new nokia.maps.map.component.Overview(), // ScaleBar new nokia.maps.map.component.ScaleBar(), // Positioning new nokia.maps.positioning.component.Positioning(), // ContextMenu new nokia.maps.map.component.ContextMenu() ] });
, . , , , , . , . Wi-Fi, — GPS . :
if (nokia.maps.positioning.Manager) { var positioning = new nokia.maps.positioning.Manager(); positioning.getCurrentPosition( function (position) { window.coords = position.coords, // marker = new nokia.maps.map.StandardMarker(coords), // // , accuracyCircle = new nokia.maps.map.Circle(coords, coords.accuracy); // map.objects.addAll([accuracyCircle, marker]); // , map.zoomTo(accuracyCircle.getBoundingBox(), false, "default"); }, // - GPS function (error) { var errorMsg = " : "; // if (error.code == 1) errorMsg += " "; else if (error.code == 2) errorMsg += " "; else if (error.code == 3) errorMsg += ""; else errorMsg += " "; // alert(errorMsg); } ); }
, Nokia :
// Nokia ( 10, ) var nokia_marker = new nokia.maps.map.Marker( new nokia.maps.geo.Coordinate(55.753105, 37.605858),{ title: "Nokia office", visibility: true, icon: "http://habrastorage.org/storage2/772/09f/d91/77209fd919c23f77c10ff6451f1746d0.png", // ( 48 48 ) anchor: new nokia.maps.util.Point(24, 24) }); // map.objects.add(nokia_marker);
, . Nokia , :
var onRouteCalculated = function (observedRouter, key, value) { if (value == "finished") { var routes = observedRouter.getRoutes(); // var mapRoute = new nokia.maps.routing.component.RouteResultSet(routes[0]).container; map.objects.add(mapRoute); // map.zoomTo(mapRoute.getBoundingBox(), false, "default"); } else if (value == "failed") { alert("The routing request failed."); } }; // 'state' , onRouteCalculated , router.addObserver("state", onRouteCalculated); // var waypoints = new nokia.maps.routing.WaypointParameterList(); waypoints.addCoordinate(new nokia.maps.geo.Coordinate(55.753105, 37.605858)); waypoints.addCoordinate(new nokia.maps.geo.Coordinate(55.752316, 37.614188)); /* , transportModes, RoutingOptions trafficMode / http://api.maps.nokia.com/en/apireference/2.2.1/symbols/nokia.maps.routing.Mode.html */ var modes = [{ type: "shortest", transportModes: ["car"], options: "avoidTollroad", trafficMode: "default" }];
, . router.calculateRoute(waypoints, modes);
, .
Nokia: , , , .
:
<div id="helperContainer"> <ul> <li><a id="u_r_here" href="#"> </a></li> <li><a id="nokia_office" href="#"> Nokia </a></li> <li><a id="kremlin" href="#"> Nokia </a></li> </ul> </div>
, :
#helperContainer {z-index:100;display: inline-block;position: absolute;width: auto;height: auto;border-radius: 5px;background-color: rgba(0,0,0,0.8);top:8px;left: 40px;} ul {list-style-type: none;} li {display:inline-block; padding:3 5px;} li a {color:#fff;text-decoration: none;font: 12px/12px "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;}
: :
// $('#u_r_here').bind('click', function(e){ e.preventDefault() // map.set("center", coords); map.zoomTo(accuracyCircle.getBoundingBox(), false, "default"); }); $('#nokia_office').bind('click', function(e){ e.preventDefault() // Nokia map.set("center", [55.753105, 37.605858]); map.set("zoomLevel", 16); }); $('#kremlin').bind('click', function(e){ e.preventDefault() // Nokia . — %) router.calculateRoute(waypoints, modes); });
, , , github:gist .
Nokia Maps JS API , , . . API JavaScript , Qt Java ME .
RESTful- Nokia Maps Nokia Places Points of Interests ( ).
javascript:
nokia.Settings.set("appId", "_peU-uCkp-j8ovkzFGNU"); nokia.Settings.set("authenticationToken", "gBoUkAMoxoqIWfxWA5DuMQ"); // . nokia.Settings.set("defaultLanguage", "ru-RU"); // DOM-, Nokia var mapContainer = document.getElementById("mapContainer"); // mapContainer // DOM- var map = new nokia.maps.map.Display(mapContainer, { // , , center: [55.752316, 37.614188], // zoomLevel: 10, components: [ // // ZoomBar new nokia.maps.map.component.ZoomBar(), // Behavior new nokia.maps.map.component.Behavior(), // TypeSelector ( , , ) new nokia.maps.map.component.TypeSelector(), // Traffic / new nokia.maps.map.component.Traffic(), // PublicTransport / new nokia.maps.map.component.PublicTransport(), // Overview - new nokia.maps.map.component.Overview(), // ScaleBar new nokia.maps.map.component.ScaleBar(), // Positioning new nokia.maps.positioning.component.Positioning(), // ContextMenu new nokia.maps.map.component.ContextMenu() ] });
, . , , , , . , . Wi-Fi, — GPS . :
if (nokia.maps.positioning.Manager) { var positioning = new nokia.maps.positioning.Manager(); positioning.getCurrentPosition( function (position) { window.coords = position.coords, // marker = new nokia.maps.map.StandardMarker(coords), // // , accuracyCircle = new nokia.maps.map.Circle(coords, coords.accuracy); // map.objects.addAll([accuracyCircle, marker]); // , map.zoomTo(accuracyCircle.getBoundingBox(), false, "default"); }, // - GPS function (error) { var errorMsg = " : "; // if (error.code == 1) errorMsg += " "; else if (error.code == 2) errorMsg += " "; else if (error.code == 3) errorMsg += ""; else errorMsg += " "; // alert(errorMsg); } ); }
, Nokia :
// Nokia ( 10, ) var nokia_marker = new nokia.maps.map.Marker( new nokia.maps.geo.Coordinate(55.753105, 37.605858),{ title: "Nokia office", visibility: true, icon: "http://habrastorage.org/storage2/772/09f/d91/77209fd919c23f77c10ff6451f1746d0.png", // ( 48 48 ) anchor: new nokia.maps.util.Point(24, 24) }); // map.objects.add(nokia_marker);
, . Nokia , :
var onRouteCalculated = function (observedRouter, key, value) { if (value == "finished") { var routes = observedRouter.getRoutes(); // var mapRoute = new nokia.maps.routing.component.RouteResultSet(routes[0]).container; map.objects.add(mapRoute); // map.zoomTo(mapRoute.getBoundingBox(), false, "default"); } else if (value == "failed") { alert("The routing request failed."); } }; // 'state' , onRouteCalculated , router.addObserver("state", onRouteCalculated); // var waypoints = new nokia.maps.routing.WaypointParameterList(); waypoints.addCoordinate(new nokia.maps.geo.Coordinate(55.753105, 37.605858)); waypoints.addCoordinate(new nokia.maps.geo.Coordinate(55.752316, 37.614188)); /* , transportModes, RoutingOptions trafficMode / http://api.maps.nokia.com/en/apireference/2.2.1/symbols/nokia.maps.routing.Mode.html */ var modes = [{ type: "shortest", transportModes: ["car"], options: "avoidTollroad", trafficMode: "default" }];
, . router.calculateRoute(waypoints, modes);
, .
Nokia: , , , .
:
<div id="helperContainer"> <ul> <li><a id="u_r_here" href="#"> </a></li> <li><a id="nokia_office" href="#"> Nokia </a></li> <li><a id="kremlin" href="#"> Nokia </a></li> </ul> </div>
, :
#helperContainer {z-index:100;display: inline-block;position: absolute;width: auto;height: auto;border-radius: 5px;background-color: rgba(0,0,0,0.8);top:8px;left: 40px;} ul {list-style-type: none;} li {display:inline-block; padding:3 5px;} li a {color:#fff;text-decoration: none;font: 12px/12px "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;}
: :
// $('#u_r_here').bind('click', function(e){ e.preventDefault() // map.set("center", coords); map.zoomTo(accuracyCircle.getBoundingBox(), false, "default"); }); $('#nokia_office').bind('click', function(e){ e.preventDefault() // Nokia map.set("center", [55.753105, 37.605858]); map.set("zoomLevel", 16); }); $('#kremlin').bind('click', function(e){ e.preventDefault() // Nokia . — %) router.calculateRoute(waypoints, modes); });
, , , github:gist .
Nokia Maps JS API , , . . API JavaScript , Qt Java ME .
RESTful- Nokia Maps Nokia Places Points of Interests ( ).
javascript:
nokia.Settings.set("appId", "_peU-uCkp-j8ovkzFGNU"); nokia.Settings.set("authenticationToken", "gBoUkAMoxoqIWfxWA5DuMQ"); // . nokia.Settings.set("defaultLanguage", "ru-RU"); // DOM-, Nokia var mapContainer = document.getElementById("mapContainer"); // mapContainer // DOM- var map = new nokia.maps.map.Display(mapContainer, { // , , center: [55.752316, 37.614188], // zoomLevel: 10, components: [ // // ZoomBar new nokia.maps.map.component.ZoomBar(), // Behavior new nokia.maps.map.component.Behavior(), // TypeSelector ( , , ) new nokia.maps.map.component.TypeSelector(), // Traffic / new nokia.maps.map.component.Traffic(), // PublicTransport / new nokia.maps.map.component.PublicTransport(), // Overview - new nokia.maps.map.component.Overview(), // ScaleBar new nokia.maps.map.component.ScaleBar(), // Positioning new nokia.maps.positioning.component.Positioning(), // ContextMenu new nokia.maps.map.component.ContextMenu() ] });
, . , , , , . , . Wi-Fi, — GPS . :
if (nokia.maps.positioning.Manager) { var positioning = new nokia.maps.positioning.Manager(); positioning.getCurrentPosition( function (position) { window.coords = position.coords, // marker = new nokia.maps.map.StandardMarker(coords), // // , accuracyCircle = new nokia.maps.map.Circle(coords, coords.accuracy); // map.objects.addAll([accuracyCircle, marker]); // , map.zoomTo(accuracyCircle.getBoundingBox(), false, "default"); }, // - GPS function (error) { var errorMsg = " : "; // if (error.code == 1) errorMsg += " "; else if (error.code == 2) errorMsg += " "; else if (error.code == 3) errorMsg += ""; else errorMsg += " "; // alert(errorMsg); } ); }
, Nokia :
// Nokia ( 10, ) var nokia_marker = new nokia.maps.map.Marker( new nokia.maps.geo.Coordinate(55.753105, 37.605858),{ title: "Nokia office", visibility: true, icon: "http://habrastorage.org/storage2/772/09f/d91/77209fd919c23f77c10ff6451f1746d0.png", // ( 48 48 ) anchor: new nokia.maps.util.Point(24, 24) }); // map.objects.add(nokia_marker);
, . Nokia , :
var onRouteCalculated = function (observedRouter, key, value) { if (value == "finished") { var routes = observedRouter.getRoutes(); // var mapRoute = new nokia.maps.routing.component.RouteResultSet(routes[0]).container; map.objects.add(mapRoute); // map.zoomTo(mapRoute.getBoundingBox(), false, "default"); } else if (value == "failed") { alert("The routing request failed."); } }; // 'state' , onRouteCalculated , router.addObserver("state", onRouteCalculated); // var waypoints = new nokia.maps.routing.WaypointParameterList(); waypoints.addCoordinate(new nokia.maps.geo.Coordinate(55.753105, 37.605858)); waypoints.addCoordinate(new nokia.maps.geo.Coordinate(55.752316, 37.614188)); /* , transportModes, RoutingOptions trafficMode / http://api.maps.nokia.com/en/apireference/2.2.1/symbols/nokia.maps.routing.Mode.html */ var modes = [{ type: "shortest", transportModes: ["car"], options: "avoidTollroad", trafficMode: "default" }];
, . router.calculateRoute(waypoints, modes);
, .
Nokia: , , , .
:
<div id="helperContainer"> <ul> <li><a id="u_r_here" href="#"> </a></li> <li><a id="nokia_office" href="#"> Nokia </a></li> <li><a id="kremlin" href="#"> Nokia </a></li> </ul> </div>
, :
#helperContainer {z-index:100;display: inline-block;position: absolute;width: auto;height: auto;border-radius: 5px;background-color: rgba(0,0,0,0.8);top:8px;left: 40px;} ul {list-style-type: none;} li {display:inline-block; padding:3 5px;} li a {color:#fff;text-decoration: none;font: 12px/12px "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;}
: :
// $('#u_r_here').bind('click', function(e){ e.preventDefault() // map.set("center", coords); map.zoomTo(accuracyCircle.getBoundingBox(), false, "default"); }); $('#nokia_office').bind('click', function(e){ e.preventDefault() // Nokia map.set("center", [55.753105, 37.605858]); map.set("zoomLevel", 16); }); $('#kremlin').bind('click', function(e){ e.preventDefault() // Nokia . — %) router.calculateRoute(waypoints, modes); });
, , , github:gist .
Nokia Maps JS API , , . . API JavaScript , Qt Java ME .
RESTful- Nokia Maps Nokia Places Points of Interests ( ).
javascript:
nokia.Settings.set("appId", "_peU-uCkp-j8ovkzFGNU"); nokia.Settings.set("authenticationToken", "gBoUkAMoxoqIWfxWA5DuMQ"); // . nokia.Settings.set("defaultLanguage", "ru-RU"); // DOM-, Nokia var mapContainer = document.getElementById("mapContainer"); // mapContainer // DOM- var map = new nokia.maps.map.Display(mapContainer, { // , , center: [55.752316, 37.614188], // zoomLevel: 10, components: [ // // ZoomBar new nokia.maps.map.component.ZoomBar(), // Behavior new nokia.maps.map.component.Behavior(), // TypeSelector ( , , ) new nokia.maps.map.component.TypeSelector(), // Traffic / new nokia.maps.map.component.Traffic(), // PublicTransport / new nokia.maps.map.component.PublicTransport(), // Overview - new nokia.maps.map.component.Overview(), // ScaleBar new nokia.maps.map.component.ScaleBar(), // Positioning new nokia.maps.positioning.component.Positioning(), // ContextMenu new nokia.maps.map.component.ContextMenu() ] });
, . , , , , . , . Wi-Fi, — GPS . :
if (nokia.maps.positioning.Manager) { var positioning = new nokia.maps.positioning.Manager(); positioning.getCurrentPosition( function (position) { window.coords = position.coords, // marker = new nokia.maps.map.StandardMarker(coords), // // , accuracyCircle = new nokia.maps.map.Circle(coords, coords.accuracy); // map.objects.addAll([accuracyCircle, marker]); // , map.zoomTo(accuracyCircle.getBoundingBox(), false, "default"); }, // - GPS function (error) { var errorMsg = " : "; // if (error.code == 1) errorMsg += " "; else if (error.code == 2) errorMsg += " "; else if (error.code == 3) errorMsg += ""; else errorMsg += " "; // alert(errorMsg); } ); }
, Nokia :
// Nokia ( 10, ) var nokia_marker = new nokia.maps.map.Marker( new nokia.maps.geo.Coordinate(55.753105, 37.605858),{ title: "Nokia office", visibility: true, icon: "http://habrastorage.org/storage2/772/09f/d91/77209fd919c23f77c10ff6451f1746d0.png", // ( 48 48 ) anchor: new nokia.maps.util.Point(24, 24) }); // map.objects.add(nokia_marker);
, . Nokia , :
var onRouteCalculated = function (observedRouter, key, value) { if (value == "finished") { var routes = observedRouter.getRoutes(); // var mapRoute = new nokia.maps.routing.component.RouteResultSet(routes[0]).container; map.objects.add(mapRoute); // map.zoomTo(mapRoute.getBoundingBox(), false, "default"); } else if (value == "failed") { alert("The routing request failed."); } }; // 'state' , onRouteCalculated , router.addObserver("state", onRouteCalculated); // var waypoints = new nokia.maps.routing.WaypointParameterList(); waypoints.addCoordinate(new nokia.maps.geo.Coordinate(55.753105, 37.605858)); waypoints.addCoordinate(new nokia.maps.geo.Coordinate(55.752316, 37.614188)); /* , transportModes, RoutingOptions trafficMode / http://api.maps.nokia.com/en/apireference/2.2.1/symbols/nokia.maps.routing.Mode.html */ var modes = [{ type: "shortest", transportModes: ["car"], options: "avoidTollroad", trafficMode: "default" }];
, . router.calculateRoute(waypoints, modes);
, .
Nokia: , , , .
:
<div id="helperContainer"> <ul> <li><a id="u_r_here" href="#"> </a></li> <li><a id="nokia_office" href="#"> Nokia </a></li> <li><a id="kremlin" href="#"> Nokia </a></li> </ul> </div>
, :
#helperContainer {z-index:100;display: inline-block;position: absolute;width: auto;height: auto;border-radius: 5px;background-color: rgba(0,0,0,0.8);top:8px;left: 40px;} ul {list-style-type: none;} li {display:inline-block; padding:3 5px;} li a {color:#fff;text-decoration: none;font: 12px/12px "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;}
: :
// $('#u_r_here').bind('click', function(e){ e.preventDefault() // map.set("center", coords); map.zoomTo(accuracyCircle.getBoundingBox(), false, "default"); }); $('#nokia_office').bind('click', function(e){ e.preventDefault() // Nokia map.set("center", [55.753105, 37.605858]); map.set("zoomLevel", 16); }); $('#kremlin').bind('click', function(e){ e.preventDefault() // Nokia . — %) router.calculateRoute(waypoints, modes); });
, , , github:gist .
Nokia Maps JS API , , . . API JavaScript , Qt Java ME .
RESTful- Nokia Maps Nokia Places Points of Interests ( ).
javascript:
nokia.Settings.set("appId", "_peU-uCkp-j8ovkzFGNU"); nokia.Settings.set("authenticationToken", "gBoUkAMoxoqIWfxWA5DuMQ"); // . nokia.Settings.set("defaultLanguage", "ru-RU"); // DOM-, Nokia var mapContainer = document.getElementById("mapContainer"); // mapContainer // DOM- var map = new nokia.maps.map.Display(mapContainer, { // , , center: [55.752316, 37.614188], // zoomLevel: 10, components: [ // // ZoomBar new nokia.maps.map.component.ZoomBar(), // Behavior new nokia.maps.map.component.Behavior(), // TypeSelector ( , , ) new nokia.maps.map.component.TypeSelector(), // Traffic / new nokia.maps.map.component.Traffic(), // PublicTransport / new nokia.maps.map.component.PublicTransport(), // Overview - new nokia.maps.map.component.Overview(), // ScaleBar new nokia.maps.map.component.ScaleBar(), // Positioning new nokia.maps.positioning.component.Positioning(), // ContextMenu new nokia.maps.map.component.ContextMenu() ] });
, . , , , , . , . Wi-Fi, — GPS . :
if (nokia.maps.positioning.Manager) { var positioning = new nokia.maps.positioning.Manager(); positioning.getCurrentPosition( function (position) { window.coords = position.coords, // marker = new nokia.maps.map.StandardMarker(coords), // // , accuracyCircle = new nokia.maps.map.Circle(coords, coords.accuracy); // map.objects.addAll([accuracyCircle, marker]); // , map.zoomTo(accuracyCircle.getBoundingBox(), false, "default"); }, // - GPS function (error) { var errorMsg = " : "; // if (error.code == 1) errorMsg += " "; else if (error.code == 2) errorMsg += " "; else if (error.code == 3) errorMsg += ""; else errorMsg += " "; // alert(errorMsg); } ); }
, Nokia :
// Nokia ( 10, ) var nokia_marker = new nokia.maps.map.Marker( new nokia.maps.geo.Coordinate(55.753105, 37.605858),{ title: "Nokia office", visibility: true, icon: "http://habrastorage.org/storage2/772/09f/d91/77209fd919c23f77c10ff6451f1746d0.png", // ( 48 48 ) anchor: new nokia.maps.util.Point(24, 24) }); // map.objects.add(nokia_marker);
, . Nokia , :
var onRouteCalculated = function (observedRouter, key, value) { if (value == "finished") { var routes = observedRouter.getRoutes(); // var mapRoute = new nokia.maps.routing.component.RouteResultSet(routes[0]).container; map.objects.add(mapRoute); // map.zoomTo(mapRoute.getBoundingBox(), false, "default"); } else if (value == "failed") { alert("The routing request failed."); } }; // 'state' , onRouteCalculated , router.addObserver("state", onRouteCalculated); // var waypoints = new nokia.maps.routing.WaypointParameterList(); waypoints.addCoordinate(new nokia.maps.geo.Coordinate(55.753105, 37.605858)); waypoints.addCoordinate(new nokia.maps.geo.Coordinate(55.752316, 37.614188)); /* , transportModes, RoutingOptions trafficMode / http://api.maps.nokia.com/en/apireference/2.2.1/symbols/nokia.maps.routing.Mode.html */ var modes = [{ type: "shortest", transportModes: ["car"], options: "avoidTollroad", trafficMode: "default" }];
, . router.calculateRoute(waypoints, modes);
, .
Nokia: , , , .
:
<div id="helperContainer"> <ul> <li><a id="u_r_here" href="#"> </a></li> <li><a id="nokia_office" href="#"> Nokia </a></li> <li><a id="kremlin" href="#"> Nokia </a></li> </ul> </div>
, :
#helperContainer {z-index:100;display: inline-block;position: absolute;width: auto;height: auto;border-radius: 5px;background-color: rgba(0,0,0,0.8);top:8px;left: 40px;} ul {list-style-type: none;} li {display:inline-block; padding:3 5px;} li a {color:#fff;text-decoration: none;font: 12px/12px "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;}
: :
// $('#u_r_here').bind('click', function(e){ e.preventDefault() // map.set("center", coords); map.zoomTo(accuracyCircle.getBoundingBox(), false, "default"); }); $('#nokia_office').bind('click', function(e){ e.preventDefault() // Nokia map.set("center", [55.753105, 37.605858]); map.set("zoomLevel", 16); }); $('#kremlin').bind('click', function(e){ e.preventDefault() // Nokia . — %) router.calculateRoute(waypoints, modes); });
, , , github:gist .
Nokia Maps JS API , , . . API JavaScript , Qt Java ME .
RESTful- Nokia Maps Nokia Places Points of Interests ( ).
javascript:
nokia.Settings.set("appId", "_peU-uCkp-j8ovkzFGNU"); nokia.Settings.set("authenticationToken", "gBoUkAMoxoqIWfxWA5DuMQ"); // . nokia.Settings.set("defaultLanguage", "ru-RU"); // DOM-, Nokia var mapContainer = document.getElementById("mapContainer"); // mapContainer // DOM- var map = new nokia.maps.map.Display(mapContainer, { // , , center: [55.752316, 37.614188], // zoomLevel: 10, components: [ // // ZoomBar new nokia.maps.map.component.ZoomBar(), // Behavior new nokia.maps.map.component.Behavior(), // TypeSelector ( , , ) new nokia.maps.map.component.TypeSelector(), // Traffic / new nokia.maps.map.component.Traffic(), // PublicTransport / new nokia.maps.map.component.PublicTransport(), // Overview - new nokia.maps.map.component.Overview(), // ScaleBar new nokia.maps.map.component.ScaleBar(), // Positioning new nokia.maps.positioning.component.Positioning(), // ContextMenu new nokia.maps.map.component.ContextMenu() ] });
, . , , , , . , . Wi-Fi, — GPS . :
if (nokia.maps.positioning.Manager) { var positioning = new nokia.maps.positioning.Manager(); positioning.getCurrentPosition( function (position) { window.coords = position.coords, // marker = new nokia.maps.map.StandardMarker(coords), // // , accuracyCircle = new nokia.maps.map.Circle(coords, coords.accuracy); // map.objects.addAll([accuracyCircle, marker]); // , map.zoomTo(accuracyCircle.getBoundingBox(), false, "default"); }, // - GPS function (error) { var errorMsg = " : "; // if (error.code == 1) errorMsg += " "; else if (error.code == 2) errorMsg += " "; else if (error.code == 3) errorMsg += ""; else errorMsg += " "; // alert(errorMsg); } ); }
, Nokia :
// Nokia ( 10, ) var nokia_marker = new nokia.maps.map.Marker( new nokia.maps.geo.Coordinate(55.753105, 37.605858),{ title: "Nokia office", visibility: true, icon: "http://habrastorage.org/storage2/772/09f/d91/77209fd919c23f77c10ff6451f1746d0.png", // ( 48 48 ) anchor: new nokia.maps.util.Point(24, 24) }); // map.objects.add(nokia_marker);
, . Nokia , :
var onRouteCalculated = function (observedRouter, key, value) { if (value == "finished") { var routes = observedRouter.getRoutes(); // var mapRoute = new nokia.maps.routing.component.RouteResultSet(routes[0]).container; map.objects.add(mapRoute); // map.zoomTo(mapRoute.getBoundingBox(), false, "default"); } else if (value == "failed") { alert("The routing request failed."); } }; // 'state' , onRouteCalculated , router.addObserver("state", onRouteCalculated); // var waypoints = new nokia.maps.routing.WaypointParameterList(); waypoints.addCoordinate(new nokia.maps.geo.Coordinate(55.753105, 37.605858)); waypoints.addCoordinate(new nokia.maps.geo.Coordinate(55.752316, 37.614188)); /* , transportModes, RoutingOptions trafficMode / http://api.maps.nokia.com/en/apireference/2.2.1/symbols/nokia.maps.routing.Mode.html */ var modes = [{ type: "shortest", transportModes: ["car"], options: "avoidTollroad", trafficMode: "default" }];
, . router.calculateRoute(waypoints, modes);
, .
Nokia: , , , .
:
<div id="helperContainer"> <ul> <li><a id="u_r_here" href="#"> </a></li> <li><a id="nokia_office" href="#"> Nokia </a></li> <li><a id="kremlin" href="#"> Nokia </a></li> </ul> </div>
, :
#helperContainer {z-index:100;display: inline-block;position: absolute;width: auto;height: auto;border-radius: 5px;background-color: rgba(0,0,0,0.8);top:8px;left: 40px;} ul {list-style-type: none;} li {display:inline-block; padding:3 5px;} li a {color:#fff;text-decoration: none;font: 12px/12px "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;}
: :
// $('#u_r_here').bind('click', function(e){ e.preventDefault() // map.set("center", coords); map.zoomTo(accuracyCircle.getBoundingBox(), false, "default"); }); $('#nokia_office').bind('click', function(e){ e.preventDefault() // Nokia map.set("center", [55.753105, 37.605858]); map.set("zoomLevel", 16); }); $('#kremlin').bind('click', function(e){ e.preventDefault() // Nokia . — %) router.calculateRoute(waypoints, modes); });
, , , github:gist .
Nokia Maps JS API , , . . API JavaScript , Qt Java ME .
RESTful- Nokia Maps Nokia Places Points of Interests ( ).
javascript:
nokia.Settings.set("appId", "_peU-uCkp-j8ovkzFGNU"); nokia.Settings.set("authenticationToken", "gBoUkAMoxoqIWfxWA5DuMQ"); // . nokia.Settings.set("defaultLanguage", "ru-RU"); // DOM-, Nokia var mapContainer = document.getElementById("mapContainer"); // mapContainer // DOM- var map = new nokia.maps.map.Display(mapContainer, { // , , center: [55.752316, 37.614188], // zoomLevel: 10, components: [ // // ZoomBar new nokia.maps.map.component.ZoomBar(), // Behavior new nokia.maps.map.component.Behavior(), // TypeSelector ( , , ) new nokia.maps.map.component.TypeSelector(), // Traffic / new nokia.maps.map.component.Traffic(), // PublicTransport / new nokia.maps.map.component.PublicTransport(), // Overview - new nokia.maps.map.component.Overview(), // ScaleBar new nokia.maps.map.component.ScaleBar(), // Positioning new nokia.maps.positioning.component.Positioning(), // ContextMenu new nokia.maps.map.component.ContextMenu() ] });
, . , , , , . , . Wi-Fi, — GPS . :
if (nokia.maps.positioning.Manager) { var positioning = new nokia.maps.positioning.Manager(); positioning.getCurrentPosition( function (position) { window.coords = position.coords, // marker = new nokia.maps.map.StandardMarker(coords), // // , accuracyCircle = new nokia.maps.map.Circle(coords, coords.accuracy); // map.objects.addAll([accuracyCircle, marker]); // , map.zoomTo(accuracyCircle.getBoundingBox(), false, "default"); }, // - GPS function (error) { var errorMsg = " : "; // if (error.code == 1) errorMsg += " "; else if (error.code == 2) errorMsg += " "; else if (error.code == 3) errorMsg += ""; else errorMsg += " "; // alert(errorMsg); } ); }
, Nokia :
// Nokia ( 10, ) var nokia_marker = new nokia.maps.map.Marker( new nokia.maps.geo.Coordinate(55.753105, 37.605858),{ title: "Nokia office", visibility: true, icon: "http://habrastorage.org/storage2/772/09f/d91/77209fd919c23f77c10ff6451f1746d0.png", // ( 48 48 ) anchor: new nokia.maps.util.Point(24, 24) }); // map.objects.add(nokia_marker);
, . Nokia , :
var onRouteCalculated = function (observedRouter, key, value) { if (value == "finished") { var routes = observedRouter.getRoutes(); // var mapRoute = new nokia.maps.routing.component.RouteResultSet(routes[0]).container; map.objects.add(mapRoute); // map.zoomTo(mapRoute.getBoundingBox(), false, "default"); } else if (value == "failed") { alert("The routing request failed."); } }; // 'state' , onRouteCalculated , router.addObserver("state", onRouteCalculated); // var waypoints = new nokia.maps.routing.WaypointParameterList(); waypoints.addCoordinate(new nokia.maps.geo.Coordinate(55.753105, 37.605858)); waypoints.addCoordinate(new nokia.maps.geo.Coordinate(55.752316, 37.614188)); /* , transportModes, RoutingOptions trafficMode / http://api.maps.nokia.com/en/apireference/2.2.1/symbols/nokia.maps.routing.Mode.html */ var modes = [{ type: "shortest", transportModes: ["car"], options: "avoidTollroad", trafficMode: "default" }];
, . router.calculateRoute(waypoints, modes);
, .
Nokia: , , , .
:
<div id="helperContainer"> <ul> <li><a id="u_r_here" href="#"> </a></li> <li><a id="nokia_office" href="#"> Nokia </a></li> <li><a id="kremlin" href="#"> Nokia </a></li> </ul> </div>
, :
#helperContainer {z-index:100;display: inline-block;position: absolute;width: auto;height: auto;border-radius: 5px;background-color: rgba(0,0,0,0.8);top:8px;left: 40px;} ul {list-style-type: none;} li {display:inline-block; padding:3 5px;} li a {color:#fff;text-decoration: none;font: 12px/12px "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;}
: :
// $('#u_r_here').bind('click', function(e){ e.preventDefault() // map.set("center", coords); map.zoomTo(accuracyCircle.getBoundingBox(), false, "default"); }); $('#nokia_office').bind('click', function(e){ e.preventDefault() // Nokia map.set("center", [55.753105, 37.605858]); map.set("zoomLevel", 16); }); $('#kremlin').bind('click', function(e){ e.preventDefault() // Nokia . — %) router.calculateRoute(waypoints, modes); });
, , , github:gist .
Nokia Maps JS API , , . . API JavaScript , Qt Java ME .
RESTful- Nokia Maps Nokia Places Points of Interests ( ).
javascript:
nokia.Settings.set("appId", "_peU-uCkp-j8ovkzFGNU"); nokia.Settings.set("authenticationToken", "gBoUkAMoxoqIWfxWA5DuMQ"); // . nokia.Settings.set("defaultLanguage", "ru-RU"); // DOM-, Nokia var mapContainer = document.getElementById("mapContainer"); // mapContainer // DOM- var map = new nokia.maps.map.Display(mapContainer, { // , , center: [55.752316, 37.614188], // zoomLevel: 10, components: [ // // ZoomBar new nokia.maps.map.component.ZoomBar(), // Behavior new nokia.maps.map.component.Behavior(), // TypeSelector ( , , ) new nokia.maps.map.component.TypeSelector(), // Traffic / new nokia.maps.map.component.Traffic(), // PublicTransport / new nokia.maps.map.component.PublicTransport(), // Overview - new nokia.maps.map.component.Overview(), // ScaleBar new nokia.maps.map.component.ScaleBar(), // Positioning new nokia.maps.positioning.component.Positioning(), // ContextMenu new nokia.maps.map.component.ContextMenu() ] });
, . , , , , . , . Wi-Fi, — GPS . :
if (nokia.maps.positioning.Manager) { var positioning = new nokia.maps.positioning.Manager(); positioning.getCurrentPosition( function (position) { window.coords = position.coords, // marker = new nokia.maps.map.StandardMarker(coords), // // , accuracyCircle = new nokia.maps.map.Circle(coords, coords.accuracy); // map.objects.addAll([accuracyCircle, marker]); // , map.zoomTo(accuracyCircle.getBoundingBox(), false, "default"); }, // - GPS function (error) { var errorMsg = " : "; // if (error.code == 1) errorMsg += " "; else if (error.code == 2) errorMsg += " "; else if (error.code == 3) errorMsg += ""; else errorMsg += " "; // alert(errorMsg); } ); }
, Nokia :
// Nokia ( 10, ) var nokia_marker = new nokia.maps.map.Marker( new nokia.maps.geo.Coordinate(55.753105, 37.605858),{ title: "Nokia office", visibility: true, icon: "http://habrastorage.org/storage2/772/09f/d91/77209fd919c23f77c10ff6451f1746d0.png", // ( 48 48 ) anchor: new nokia.maps.util.Point(24, 24) }); // map.objects.add(nokia_marker);
, . Nokia , :
var onRouteCalculated = function (observedRouter, key, value) { if (value == "finished") { var routes = observedRouter.getRoutes(); // var mapRoute = new nokia.maps.routing.component.RouteResultSet(routes[0]).container; map.objects.add(mapRoute); // map.zoomTo(mapRoute.getBoundingBox(), false, "default"); } else if (value == "failed") { alert("The routing request failed."); } }; // 'state' , onRouteCalculated , router.addObserver("state", onRouteCalculated); // var waypoints = new nokia.maps.routing.WaypointParameterList(); waypoints.addCoordinate(new nokia.maps.geo.Coordinate(55.753105, 37.605858)); waypoints.addCoordinate(new nokia.maps.geo.Coordinate(55.752316, 37.614188)); /* , transportModes, RoutingOptions trafficMode / http://api.maps.nokia.com/en/apireference/2.2.1/symbols/nokia.maps.routing.Mode.html */ var modes = [{ type: "shortest", transportModes: ["car"], options: "avoidTollroad", trafficMode: "default" }];
, . router.calculateRoute(waypoints, modes);
, .
Nokia: , , , .
:
<div id="helperContainer"> <ul> <li><a id="u_r_here" href="#"> </a></li> <li><a id="nokia_office" href="#"> Nokia </a></li> <li><a id="kremlin" href="#"> Nokia </a></li> </ul> </div>
, :
#helperContainer {z-index:100;display: inline-block;position: absolute;width: auto;height: auto;border-radius: 5px;background-color: rgba(0,0,0,0.8);top:8px;left: 40px;} ul {list-style-type: none;} li {display:inline-block; padding:3 5px;} li a {color:#fff;text-decoration: none;font: 12px/12px "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;}
: :
// $('#u_r_here').bind('click', function(e){ e.preventDefault() // map.set("center", coords); map.zoomTo(accuracyCircle.getBoundingBox(), false, "default"); }); $('#nokia_office').bind('click', function(e){ e.preventDefault() // Nokia map.set("center", [55.753105, 37.605858]); map.set("zoomLevel", 16); }); $('#kremlin').bind('click', function(e){ e.preventDefault() // Nokia . — %) router.calculateRoute(waypoints, modes); });
, , , github:gist .
Nokia Maps JS API , , . . API JavaScript , Qt Java ME .
RESTful- Nokia Maps Nokia Places Points of Interests ( ).