@@ -10,16 +10,21 @@ import {
1010 LPolygon ,
1111 LPolyline ,
1212 LRectangle ,
13+ LControlAttribution ,
14+ LControlLayers ,
15+ LControlZoom ,
16+ LControlScale
1317} from ' ../src' ;
1418import ' ../node_modules/leaflet/dist/leaflet.css' ;
19+ import L from ' leaflet' ;
1520
1621const mapOptions = {
1722 zoom: 13 ,
1823 center: { lat: 51.505 , lng: - 0.09 },
1924 minZoom: 8 ,
2025 maxZoom: 15 ,
21- attributionControl: true ,
22- zoomControl: true
26+ attributionControl: false ,
27+ zoomControl: false
2328}
2429
2530const tileLayerOptions = {
@@ -31,11 +36,28 @@ const tileLayerOptions = {
3136 accessToken: ' pk.eyJ1IjoieHdwaXNtZSIsImEiOiJ5cTlCQTlRIn0.QdV-wNUKbgs7jAlbVE747Q'
3237}
3338
39+ const baseLayerOptions = {
40+ geoqBlue: new L .TileLayer (
41+ " http://map.geoq.cn/ArcGIS/rest/services/ChinaOnlineStreetPurplishBlue/MapServer/tile/{z}/{y}/{x}" ,
42+ {
43+ attribution: " geoq blue"
44+ }
45+ ),
46+ ' 高德影像' : new L .TileLayer (
47+ " http://webst0{s}.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}" ,
48+ {
49+ subdomains: " 1234" ,
50+ attribution: " 高德影像"
51+ }
52+ )
53+ }
54+
55+
3456 </script >
3557
3658<template >
3759 <div >
38- <h1 >Marker/Tooltip/Popup </h1 >
60+ <h1 >Basic UI Layers </h1 >
3961 <l-map id =" map1" :options =" mapOptions" >
4062 <l-tilelayer urlTemplate =" https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}"
4163 :options =" tileLayerOptions" />
@@ -59,7 +81,7 @@ const tileLayerOptions = {
5981 <h1 >Vector Layers</h1 >
6082 <l-map id =" map2" :options =" mapOptions" >
6183 <l-tilelayer urlTemplate =" https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}"
62- :options =" tileLayerOptions" />
84+ :options =" tileLayerOptions" />
6385 <l-circle :latlng =" [51.508, -0.11]" :options =" {
6486 color: 'red',
6587 fillColor: '#f03',
@@ -90,14 +112,17 @@ const tileLayerOptions = {
90112 </div >
91113 <div >
92114 <h1 >Control</h1 >
93- <l-map id =" map3" :options =" mapOptions" >
115+ <l-map id =" map3" :options =" {
116+ ...mapOptions,
117+ zoom: 10,
118+ center: { lat: 26.33280692289788, lng: 114.78515624999999 },
119+ }" >
94120 <l-tilelayer urlTemplate =" https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}"
95121 :options =" tileLayerOptions" />
96- <!-- <l-marker id="marker3" :latlng="{ lat: 51.505, lng: -0.2 }" :options="{
97- title: 'marker3'
98- }">
99- <l-popup :options="{ content: 'popup with marker3' }" />
100- </l-marker> -->
122+ <LControlScale />
123+ <LControlZoom :options =" { position: 'topright' }" />
124+ <LControlAttribution />
125+ <LControlLayers :base-layers =" baseLayerOptions" />
101126 </l-map >
102127 </div >
103128</template >
0 commit comments