我正在尝试将OpenStreetMap数据(osm.pbf文件)转换为"z/x/y.pbf“文件夹/文件结构,并使用Open层6和Ionic显示脱机地图。
到目前为止我所做的是:
generate-mbtiles [minzoom=0 maxzoom=16]生成mbtilesmb-util --image_format=pbf input_folder output_folder命令。在此之后,我在适当的文件夹结构中使用了pbfs --,到目前为止,很好的。this.map = new Map({
layers: [
new VectorTileLayer({
declutter: true,
source: new VectorTileSource({
format: new MVT(),
url: 'http://localhost:8100/assets/downloaded-osm-pbfs/{z}/{x}/{y}.pbf'
}),
style: createMapboxStreetsV6Style(Style, Fill, Stroke, Icon, Text)
})
],
target: 'map',
view: new View({
center: [0, 0],
zoom: 2
})
});在此之后,当我试图查看浏览器中的地图时,我就会得到"Error: Unimplemented : 6“。

有趣的是,如果我使用https://openmaptiles.com/downloads并从那里下载mbtiles并执行步骤3-4 (在步骤3中,我只是做了额外的步骤并解压缩pbfs,因为openmaptiles gzip是文件),所有内容都会正确显示,但问题是openmaptiles提供了14个缩放级别,我需要16个缩放级别。
知道如何克服这个问题吗?任何帮助都将不胜感激!
发布于 2022-11-02 14:08:35
在我的经验中,这个错误发生在PBF被压缩时,OpenLayers无法消化。试一试解开的:
gzip --decompress --recursive --suffix .pbf .https://stackoverflow.com/questions/61792947
复制相似问题