MapBox和TIFF [英] MapBox and TIFF
问题描述
我正在尝试在MapBox的地图上显示我的TIFF文件.我从以下示例开始: https://www.mapbox.com /mapbox-gl-js/example/vector-source/通过替换
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'
});
与
map.addSource('terrain-data', {
type: 'vector',
url: 'mapbox://xxx.yyy'
});
其中xxx.yyy
是我的帐户数据部分中的Map ID
( https://www .mapbox.com/studio/data/)
where xxx.yyy
is my Map ID
from Data section of the account (https://www.mapbox.com/studio/data/)
JavaScript启动所需的调用(对某些jpg
文件),但所有调用都带有404
错误和以下消息:{"message":"Tile does not exist"}
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"}
推荐答案
如果xxx.yyy
是TIFF上传产生的图块,则它是栅格图层.
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.
这篇关于MapBox和TIFF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!