首页 文章

'Pink tiles'使用GeoWebCache时

提问于
浏览
0

我'm trying to test simple web map based on PostGIS/Geoserver/OpenLayers stack on Windows Server 2008. I'已经使用了这个tutorial和geoserver docs .

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

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"

一切正常 .

谁能指出我犯错的地方?

1 回答

  • 2

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

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

相关问题