官方文档 :https://iclient.supermap.io/examples/leaflet/examples.html#iServer
Leaflet文档:https://leafletjs.com/reference-1.7.1.html
安装依赖:
npm install @supermap/iclient-leaflet
main.js
全局引入
import 'leaflet/dist/leaflet.css'
import '@supermap/iclient-leaflet'
import 'leaflet/dist/leaflet'
创建map
<template>
<div>
<div id="mapView" style="width: 100%; height: 500px"></div>
</div>
</template>
import L from "leaflet";
var host = "https://iserver.supermap.io";
var map,
url = host + "/iserver/services/map-china400/rest/maps/China_4326",
map = L.map("mapView", {
crs: L.CRS.EPSG4326,
center: [39.914714, 116.383572],
maxZoom: 18,
zoom: 11,
});
L.supermap.tiledMapLayer(url).addTo(map);
网友评论