0

我正在尝试在 Windows Server 2008 上测试基于 PostGIS/Geoserver/OpenLayers 堆栈的简单网络地图。我一直在使用本教程和 geoserver文档

当我尝试使用 GeoWebCache 将 WMS 图层添加到我的地图时:

    var index1d = new OpenLayers.Layer.WMS(
        "Index1",
        "http://localhost:1979/geoserver/gwc/service/wms",
        {'layers': "Index2000:index1d",
         'format': "image/png",
         'transparent': true
        },
        {'opacity': 1.0, 'isBaseLayer': true}

    );
    map.addLayer(index1d);

我得到了臭名昭著的“粉红色瓷砖”。Geoserver 中的错误 说:

ERROR [geowebcache.GeoWebCacheDispatcher] - Requested horizontal resolution:
750.0000000000005 , best match: 632.4668417968734 exceeds 10% threshold. 
Perhaps the client is configured  with an incorrect set of scales (resolutions),  
or the DPI setting is off compared to the one in GWC ? http://localhost:
1979/geoserver/gwc/service/wms

我的图层似乎配置正确,当我在没有 GeoWebCache 的情况下提供它时,只需:

"http://localhost:1979/geoserver/wms"

一切正常。

谁能指出我在哪里犯错?

4

1 回答 1

2

我没有使用GWC,但我猜你已经自己设置了缓存?如果是这样,我想您必须设置 GWC 将创建它的图块的比例。基于这些假设,我会说您在访问图块时必须使用相同的比例级别。查看您的 GWC 设置,并可能重新创建缓存。

(使用 WMS 将起作用,因为默认情况下地图数据是动态渲染的,采用您提供的任何参数并从中进行渲染。)

于 2010-12-20T18:00:56.313 回答