Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.
Using the RESTful Map API together with HERE Maps API
In short the HERE Maps APIs allow you to integrate HERE Maps into your web pages. The HERE Maps API offers a variety of essential map functionality out of the box like, panning, zooming and support for W3C positioning built in to modern browsers. However in some situations it is just enough to show the map image. This is where the RESTful Map API comes into play.
Firstly load the static image as shown:
<div id="mapContainer" style="width:540px; height:334px;">
<img id='HereStaticMap' src="http://m.nok.it/?c=50.5,15.5&h=334&w=540&z=4&nord&nodot&sb=k"
alt="Map of Europe" />
When the asynchronously loaded map has finished loading, ensure the map is in the correct location, and tidy up the <img> element from the DOM as shown.
// This matches the static map:
map.set("center", new nokia.maps.geo.Coordinate(50.5,15.5));
var marker = new nokia.maps.map.StandardMarker([50.5,15.5]);
The following fully working example can be found at:
- c - Centre Point 50.5° latitude 15.5 ° longitude
- h - Height 334 pixels, same as the height style of the map container <div>
- w - width 540 pixels, same as the width style of the map container <div>
- z - zoom level 4, same as the map.
- nord, nodot - The image should not attempt to redirect, no dot is required over the centre point.
- appId and token - standard authentication parameters