0

我正在尝试将 HERE 地图添加到 Leaflet,但结果如下:

在此处输入图像描述

我的 JavaScript 代码是:

var defaultPoint = {
    lat : 44.6478300,
    lon : 10.9253900
};

function initMapLeaflet(apiKey, json) {
    try {
        map.remove();
    } catch (Exception) {
    }
    var coords = JSON.parse(json);
    var center;
    if (coords.lat != null && coords.lon != null) {
        center = coords;
    } else {
        center = defaultPoint;
    }
    map = L.map({$DIV_ID}, {
        center : [ center.lat, center.lon ],
        zoom : 10,
        layers : [ L.tileLayer('https://1.base.maps.ls.hereapi.com/maptile/2.1/maptile/newest/normal.day/13/4400/2686/256/png8?apiKey=' + apiKey) ],
        zoomControl : true
    });
    map.attributionControl.addAttribution('© HERE 2019');
}

我试图通过 URL 恢复整个世界,但唯一的区别是重复的图像内容。

放大/缩小和拖动工作正常,但在之前的事件结束时,<div>再次显示相同的重复图像。

4

0 回答 0