OpenLayers 3 Local Tiles我需要使用本地磁贴。请帮忙。
我试过这个
var map = new ol.Map({
layers : [ layers['vworld'], vectorLayer ],
interactions : ol.interaction.defaults({
shiftDragZoom : false
}).extend([ new ol.interaction.DragRotateAndZoom() ]),
target : 'map',
view : new ol.View({
// center: ol.proj.transform([getLongi, getLati ], 'EPSG:4326', 'EPSG:3857'),
center : ol.proj.fromLonLat([ 127.5, 36 ]),
zoom : 7, minZoom : 6, maxZoom : 19
})
});
var layers = {};
layers['vworld'] = new ol.layer.Tile({
title : 'VWorld Gray Map', visible : true, type : 'base',
source : new ol.source.XYZ({
url : 'H:/tile/{z}/{x}/{y}.png'
})
});
不允许加载本地资源:file:///H:/tile/7/110/48.png
磁贴位于H:/tile/bla~/bla~/bla~.png
这是一个世界地图,磁贴文件夹中有许多文件夹,其中有许多PNG文件。
openlayer提供的xyz
值与我的瓷砖不同。我该怎么办?