从代码上判断不出来问题,这边提供一个demo给您。
<template>
<div id="map" ref="rootmap"></div>
</template>
<script>
import L from 'leaflet';
import '@supermap/iclient-leaflet';
export default {
data() {
return {
map: null,
// url:"https://iserver.supermap.io/iserver/services/map-world/rest/maps/World",
baseUrl:'https://iserver.supermap.io/iserver/services/map-world/rest/maps/World'
};
},
methods:{
},
mounted() {
// var mapcontainer = this.$refs.rootmap;
this.map = L.map('map', {
crs: L.CRS.EPSG4326,
center: [0, 0],
maxZoom: 18,
zoom: 1
});
new L.supermap.TiledMapLayer(this.baseUrl).addTo(this.map);
// this.query();
}
};
</script>
<style>
#map{height:1000px;}
</style>