morris
morris

Reputation: 13

Nokia Tile support in OL 3?

In OL2, I am able to connect to Nokia tiles like this:

new OpenLayers.Layer.XYZ(
        "Nokia Road",
        [
                  "http://a.maptile.maps.svc.ovi.com/maptiler/maptile/newest/normal.day/${z}/${x}/${y}/256/png8?lg=ENG&app_id=...&token=..."
        ],
        {
            attribution: "&copy; 2013 Nokia</span>&nbsp;<a hre...",
            transitionEffect: "resize"
        }
    ),

I am wondering how to do this in OL3?

Upvotes: 1

Views: 377

Answers (2)

morris
morris

Reputation: 13

Figured it out.

In OL3, I now do this:

new ol.layer.Tile({
  source: new ol.source.XYZ({
                url: "http://a.maptile.maps.svc.ovi.com/maptiler/maptile/newest/normal.day/{z}/{x}/{y}/256/png8?lg=...&token=...",
                attribution: new ol.Attribution({
                           html: '&copy; 2013 Nokia...'
                })
          })
});

Note: I needed to remove the $ from the x, y, z values in the url.

Upvotes: 0

Jonatas Walker
Jonatas Walker

Reputation: 14150

I guess you can use the same token with HERE (Nokia) tiles:

var urlhere = 'http://{1-4}.base.maps.cit.api.here.com/'
    + 'maptile/2.1/maptile/newest/normal.day/'
    + '{z}/{x}/{y}/256/png8?app_id=...&app_code=...';

UPDATE:

It can also be:

var urlhere = 'http://{a-c}.maptile.maps.svc.ovi.com/maptiler'
    + '/v2/maptile/newest/normal.day/{z}/{x}/{y}/256/png8';

Upvotes: 1

Related Questions