Javascript ';粉色瓷砖';使用GeoWebCache时

Javascript ';粉色瓷砖';使用GeoWebCache时,javascript,openlayers,geoserver,Javascript,Openlayers,Geoserver,我试图在Windows Server 2008上测试基于PostGIS/Geoserver/OpenLayers堆栈的简单web地图。我一直在使用这个和geoserver 当我尝试使用GeoWebCache将WMS图层添加到地图时: var index1d = new OpenLayers.Layer.WMS( "Index1", "http://localhost:1979/geoserver/gwc/service/wms", {'la

我试图在Windows Server 2008上测试基于PostGIS/Geoserver/OpenLayers堆栈的简单web地图。我一直在使用这个和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"
一切正常


有人能指出我犯了什么错误吗?

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

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