Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

can use nokia here REST map API in openlayer?

I'm trying to use Nokia Here Maps REST API in OpenLayers but I cannot find out how.

  1. Can Nokia Here Maps be used in OpenLayers?
  2. Does Nokia Here Maps support TMS?

Does anyone know how to use Nokia Maps by OpenLayers or OpenScales?

like image 570
Jack Avatar asked Apr 03 '13 09:04

Jack


2 Answers

Whilst this is technically possible, unless you are very careful, it is highly likely to fall foul of the Here Maps Location Services Terms and Conditions - specifically the two clauses below:

5 RESTRICTIONS

(ii) You will not ... stitch multiple static map images together to display a map that > is larger than permitted in the Location Platform Services documentation;

Subsection 5(ii) will prohibit the use of the RESTful Map API within Open Layers since you will be effectively be tiling Map Images together.

(iv) You will not remove or obscure any copyright or trademark notices or other similar notices or markings or legends from the Location Platform Services whether such notices, markings, legends or other branding originate from NAVTEQ or a third party;

Subsection 5(iv) is designed to stop someone using the the maps data without proper attribution since Nokia itself is obliged to display the copyrights on its maps where the map data has been bought in from third parties.

The simplest way to avoid this issue would be to use the HERE Map API for JavaScript, which is publicly available on the base plan and already correctly displays all the necessary copyright info.

If you are determined to use Open Layers to display your Nokia Maps, you would need to use Nokia's Map Tile service directly (The Map Tile Service does support TMS) - However this is service is only available to Enterprise customers. To gain access to this you would need to:

  1. "Request a custom package with more features" from the Pricing plans page - just click the "Contact us" button.
  2. You could then derive an OpenLayers.Layer.XYZ layer as shown in the code snippet below:

(You'll need to use the correct URL, APP_ID and TOKEN of course)

var map = new OpenLayers.Map({
    div: "map",
    projection: "EPSG:900913",
    layers: [
        new OpenLayers.Layer.XYZ(
            "HereMap", 
            [
                "MAP_TILE_BASE_URL/${z}/${x}/${y}/256/png8?lg=ENG&app_id=YOUR_APP_ID&token=YOUR_TOKEN"
            ],
            {
                attribution: "&copy; 2013 Nokia</span>&nbsp;<a href='http://maps.nokia.com/services/terms' target='_blank' title='Terms of Use' style='color:#333;text-decoration: underline;'>Terms of Use</a></div> <img src='http://api.maps.nokia.com/2.2.4/assets/ovi/mapsapi/by_here.png' border='0'>",
                transitionEffect: "resize"
            }
        )
    ],
    center: [0, 0],
    zoom: 1
});

map.addControl(new OpenLayers.Control.LayerSwitcher());

This still doesn't necessarily comply with 5(iv) however since the correct text for the copyright attribution(s) will need to be obtained from the server at run time.

like image 58
Jason Fox Avatar answered Oct 04 '22 22:10

Jason Fox


1 Yes you can use it with OpenLayers. As already noted on answer of Jason Fox, you will need a n application id and token. Just like gmaps 2 used to request.

What I am trying to do is to create a new layer that extends the OpenLayers.Layer.EventPane to attach the Here maps inside of his dom element. This is much like the OpenLayers.Layer.Google that is from where I grabbed the ideas.

2 Yes. It has this provider class nokia.maps.map.provider.ImgTileProvide.

Also the following test demonstrate that the base maps are instanceof TileProvider:

alert( '' + ( nokia.maps.map.Display.NORMAL instanceof nokia.maps.map.provider.ImgTileProvider ) );
like image 26
cavila Avatar answered Oct 05 '22 00:10

cavila