geowebcache发布arcgis切片预览出现NaN问题解决
服务预览:
查看官网配置arcgis切片操作(https://www.geowebcache.org/docs/current/configuration/layers/arcgistilingschemes.html),与我的操作一致,但是预览不了,看到网上有说,geoserver预览使用openlayers3,所以无法预览。
使用openlayers v6.3.1版本加载该服务,加载成功。所以预览不了不影响服务调用。
var projection = new ol.proj.Projection({
code: 'EPSG:4326',
units: 'degrees',
axisOrientation: 'neu'
});
let tilelayer = new ol.layer.Tile({
source: new ol.source.TileWMS({
url: 'http://localhost:8080/geowebcache/service/wms',
params: {
'LAYERS': 'tileserver',
'FORMAT': 'image/png',
'SRS': 'EPSG:4326',
'VERSION': '1.0.0'
},
// 不要tileGrid会出现400
tileGrid: new ol.tilegrid.TileGrid({
resolutions: [0.019035688046642241,0.0095178440233211203,0.0047589220116605602,0.0023794610058302801,0.00118973050291514],
tileSize: [256, 256],
origin: [-400, 400]
})
})
})
var view = new ol.View({
zoom: 7,
center: [101.749275, 24.686393],
projection: projection,
});
var map = new ol.Map({
target: 'map',
layers: [tilelayer],
view: view
});
加载服务结果: