SOURCE

console 命令行工具 X clear

                    
>
console
var map = new mapboxgl.Map({
    container: 'map',
    zoom: 7,
    center: [119.3, 29.7],
    pitch: 0,
    bearing: 0,
    style: 'https://openmap.tech/styles/streets.json',
    hash: true,
    
});

map.on('load', () => {
    map.addSource('test', {
        type: 'raster',
        tiles: [
            'http://localhost:6080/arcgis/rest/services/test/MapServer/tile/{z}/{y}/{x}'
        ],
        tileSize: 256
    });
    map.addLayer(
        {
            'id': 'test',
            'type': 'raster',
            'source': 'test',
            'paint': {}
        }
    );
})
<div id="map"></div>
#map {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    overflow: hidden;
}

本项目引用的自定义外部资源