apache+tomcat+geoserver+tilecache制作地图
如何保证openlayers的图层和你的tilecache图层具有相同的解析度和边框
我将tilecache中index.html的maxResolution设置和geoserver中的设置一样出现如下错误
An error occurred: can't find resolution index for 0.178750. Available resolutions are:
[0.703125, 0.3515625, 0.17578125, 0.087890625, 0.0439453125, 0.02197265625, 0.010986328125, 0.0054931640625, 0.00274658203125, 0.001373291015625, 0.0006866455078125, 0.00034332275390625, 0.00017
地址:http://localhost:8081/tilecache/tilecache.py?LAYERS=smart&FORMAT=image/png&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&SRS=EPSG:4326&BBOX=-42.72020816803,-44.240069389343,3.0397224426271,1.5198612213135&WIDTH=256&HEIGHT=256
tilecache:function init(){
map = new OpenLayers.Map( $('map'),{'maxResolution':0.178749728947878, numZoomLevels: 20});
layer = new OpenLayers.Layer.WMS( "smart",
"tilecache.py?", {layers: 'smart', format: 'image/png' } );
map.addLayer(layer);
map.addControl(new OpenLayers.Control.Permalink());
if (!map.getCenter()) map.zoomToMaxExtent();
}
geoserver:
var options = {
controls: [],
maxExtent: bounds,
maxResolution: 0.178749728947878,
projection: "EPSG:4326",
units: 'degrees'
};
layer styles 地图 geoserver tilecache
[解决办法]
{'maxResolution':0.178749728947878, 你把这个值改下试试0.703125