我已将阿姆斯特丹地图下载为图块,并尝试加载以下代码。问题是,当我放大网页时,下载的地图已被填充,这没问题,但是当我缩小地图时,地图变得非常小,并且网页上充满了粉红色的瓷砖。请帮忙

我的javacode如下

map = new OpenLayers.Map("map", {
                maxExtent: new OpenLayers.Bounds("-20037508.3427892,
                                                  -20037508.3427892,
                                                  20037508.3427892,
                                                  20037508.3427892"),
                restrictedExtent: new OpenLayers.Bounds("-20037508.3427892,
                                                  -20037508.3427892,
                                                  20037508.3427892,
                                                  20037508.3427892"),
                minzoomlevel: 10,
                numZoomLevels: 17,
                projection: "EPSG:900913",
                displayProjection: "EPSG:4326"} );

var layer = new OpenLayers.Layer.OSM(
      "New Layer",
      "http://localhost/WebClient/Openstreetmap/${z}/${x}/${y}.png",
    );

最佳答案

这些疯狂的数字是从哪里弄来的,为什么都一样?您应该在此处添加有效的经度和纬度值。请参见restricted extent example

07-24 18:20