<template>
<div id="map"></div>
</template>
<script>
import L from "leaflet";
import "@supermap/iclient-leaflet";
export default {
props: {},
mounted:()=>{
var map,
url =
// "https://iserver.supermap.io/iserver/services/map-world/rest/maps/World";
"http://123.234.104.58:6080/iserver/services/map-lcld/rest/maps/greenwgs84"
// var host="https://123.234.104.58:6080"
// var map, url = host + "/iserver/services/map-world/rest/maps/World";
map = L.map("map", {
crs: L.CRS.EPSG4326,
center: [120.44 , 36.19],
maxZoom: 18,
zoom: 1,
});
L.supermap.tiledMapLayer(url).addTo(map);
},
components: {},
data() {
return {};
},
methods: {},
};
</script>
<style scoped>
#map {
margin: 0;
overflow: hidden;
background: #fff;
width: 100%;
height: 100%;
position: absolute;
}
</style>
iserver地图是4326坐标系,中心点为
报错截图如下: