概述:基于现代 Web 技术栈全新构建,是 SuperMap 云 GIS 和在线 GIS 平台系列产品的统一 JavaScript 客户端。
本文档使用MapBox开发
可先下载 mapbox-gl
yarn add mapbox-ql
import mapboxgl from 'mapbox-gl';
import '@supermap/iclient-mapboxgl'; //全局组件
//样式
import 'mapbox-gl/dist/mapbox-gl.css'
一、底图
1、首先获取带有超图底图png
例如: ‘<https://iserver.supermap.io/iserver/services/map-china400/rest/maps/China/zxyTileImage.png?z={z}&x={x}&y={y>}' 超图官方链接
const scene = new mapboxgl.Map({
container: 'mapContent', // container id
style: {
"version": 8,
"sources": {
"raster-tiles": {
"type": "raster",
"tiles": [defaultdblclickURL],
"tileSize": 256
}
},
"layers": [{
"id": "map-box",
"type": "raster",
"source": "raster-tiles",
"minzoom": 4,
"maxzoom": 22
}]
},
center: [120.181128, 30.247064], // starting position
zoom: 10 // starting zoom
});