0

https://www.mapbox.com/mapbox-gl-style-spec/#sources-raster

这导致黑色瓷砖没有错误消息,我不知道为什么?

var style = {
            "version": 8,
            "sprite": "mapbox://sprites/mapbox/bright-v8",
            "glyphs": "mapbox://fonts/mapbox/{fontstack}/{range}.pbf",
            "sources": {
                "mapbox-satellite": {
                    "type": "raster",
                    "url": "mapbox://mapbox.satellite",
                    "tileSize": 256
                }
            },
            "layers": [{
                "id": "new-layer",
                "type": "background",
                "paint": {"background-color": "#111"},
                "interactive": true
            }],
        }

mapboxgl.accessToken = ...
var map = new mapboxgl.Map({
    container: 'map',
    style: style, 
    //style: 'mapbox://styles/mapbox/satellite-v8',
    center: [4.7095, 52.0393],
    zoom: 9, 
    hash: true
});
4

1 回答 1

2

看起来您只添加了 raster source。如果您希望在地图上绘制卫星图块,您还必须添加一个使用栅格源的栅格图层。https://www.mapbox.com/mapbox-gl-style-spec/#layers-raster

于 2016-02-17T19:01:50.890 回答