diff --git a/src/views/baseSource/baseSource.vue b/src/views/baseSource/baseSource.vue index 93ab5d7..d41c8ee 100644 --- a/src/views/baseSource/baseSource.vue +++ b/src/views/baseSource/baseSource.vue @@ -15,6 +15,7 @@ loading: false, icon: 'static/images/well/0100.png', map: null, + baselayer: [], msg: '' } }, @@ -25,34 +26,23 @@ initMap() { const map = L.map('map', { minZoom: 3, - maxZoom: 14, - center: [39.550339, 116.114129], - zoom: 12, + maxZoom: 18, + center: [27.75962, 116.06021], + zoom: 15, zoomControl: false, attributionControl: false, crs: L.CRS.EPSG3857 }) this.map = map // data上需要挂载 window.map = map - L.tileLayer( - // 'http://webrd01.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}' - 'http://t1.tianditu.com/vec_c/wmts?layer=vec&style=default&tilematrixset=c&Service=WMTS&Request=GetTile&Version=1.0.0&Format=tiles&TileMatrix={z}&TileCol={x}&TileRow={y}&tk=adbdd8e08c292f6cb4e3f0289f7d0447' - ).addTo(map) - // L.tileLayer( - // 'http://webrd01.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=7&x={x}&y={y}&z={z}' - // ).addTo(map) - // const greenIcon = L.icon({ - // iconUrl: this.icon, - // // shadowUrl: iconShadow, - // iconSize: [30, 50], // size of the icon - // // shadowSize: [50, 64], // size of the shadow - // iconAnchor: [15, 50], // point of the icon which will correspond to marker's location - // // shadowAnchor: [15, 64], // the same for the shadow - // popupAnchor: [0, -40] // point from which the popup should open relative to the iconAnchor - // }) - // var marker = L.marker([39.550339, 116.114129], { - // icon: greenIcon - // }).addTo(map).bindPopup('I am a green leaf.') + this.baselayer.push(L.tileLayer( + 'https://t0.tianditu.gov.cn/vec_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=vec&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=216ee92889e17ab1b083fae665d522b8', + { subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'] } + ).addTo(map)) + this.baselayer.push(L.tileLayer( + 'https://t0.tianditu.gov.cn/cva_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cva&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=216ee92889e17ab1b083fae665d522b8', + { subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'] } + ).addTo(map)) } } }