MapBox and TIFF

我与影子孤独终老i 提交于 2019-12-11 11:53:12

问题


I am trying to show my TIFF file at the MapBox's map. I am starting with this example: https://www.mapbox.com/mapbox-gl-js/example/vector-source/ by replacing

map.addSource('terrain-data', {
    type: 'vector',
    url: 'mapbox://mapbox.mapbox-terrain-v2'
});

with

map.addSource('terrain-data', {
    type: 'vector',
    url: 'mapbox://xxx.yyy'
});

where xxx.yyy is my Map ID from Data section of the account (https://www.mapbox.com/studio/data/)

JavaScript initiates needed calls (to some jpg files), but all of them come with 404 error and the following message: {"message":"Tile does not exist"}


回答1:


If xxx.yyy is a tileset resulting from a TIFF upload, it's a raster source, not a vector source. You will need to replace type: 'vector' with type: 'raster', specify tileSize: 256, and use it as the source for raster layers.



来源:https://stackoverflow.com/questions/33975728/mapbox-and-tiff

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!