Nokia Tile support in OL 3?

时间:2015-07-08 15:52:32

标签: openlayers-3 here-api

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?

2 个答案:

答案 0 :(得分:1)

我猜你可以在HERE(诺基亚)瓷砖上使用相同的标记:

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=...';

<强>更新

它也可以是:

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

答案 1 :(得分:0)

想出来。

在OL3中,我现在这样做:

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...'
                })
          })
});

注意:我需要从网址中的x,y,z值中删除 $