您好!
如果需要全模块引入,请先将 babelrc 中的配置移除,再执行全模块引入。
// babelrc中需要移除的内容
{
"plugins": [
[
"@supermapgis/babel-plugin-import",
{
"libraryName": "@supermapgis/iclient-leaflet"
}
]
]
}
// 全模块引入
import L from 'leaflet';
import '@supermapgis/iclient-leaflet';
var url = "https://iserver.supermap.io/iserver/services/map-world/rest/maps/World";
var map = L.map('map', {
crs: L.CRS.EPSG4326,
center: [0, 0],
maxZoom: 18,
zoom: 1
});
new L.supermap.TiledMapLayer(url).addTo(map);
希望可以帮助到您!