LeafLet
TileLayer : 构造的是一个切片的地址
L.tileLayer(‘https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png?{foo}’, {foo: ‘bar’, attribution: ‘© OpenStreetMap contributors’}).addTo(map);
s:表示子域名
z:表示lable
x:x方向
y:y方向
以上是高德切片地址
http://wprd0{s}.is.autonavi.com/appmaptile?x={x}&y={y}&z={z}&lang=zh_cn&size=1&scl=1&style=7
以下是可用切片代码;
// Import stylesheets
import './style.css';
import {Map,TileLayer} from 'leaflet';
// Write Javascript code!
const map = new Map('map');
const layer = new TileLayer('https://wprd01.is.autonavi.com/appmaptile?x={x}&y={y}&z={z}&lang=zh_cn&size=1&scl=2&style=8<ype=11');
layer.addTo(map);
map.setView([39,117],10);
成果图: