From 4ece8617fff2d9e250fb9178b3efc14db6c8fc81 Mon Sep 17 00:00:00 2001 From: YANGDL <114714267@qq.com> Date: 星期一, 25 一月 2021 14:42:57 +0800 Subject: [PATCH] 删除mapbox插接件和功能 --- /dev/null | 327 ------------------------------------------------------ src/router/map.js | 4 vue.config.js | 4 src/main.js | 1 package.json | 1 5 files changed, 4 insertions(+), 333 deletions(-) diff --git a/package.json b/package.json index 0e5e344..a9d5e32 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,6 @@ "lint": "vue-cli-service lint" }, "dependencies": { - "@cgcs2000/mapbox-gl": "^1.13.0", "@jiaminghi/data-view": "^2.10.0", "axios": "^0.18.0", "core-js": "^3.6.5", diff --git a/src/conf/mapbox/MCBaseMap.js b/src/conf/mapbox/MCBaseMap.js deleted file mode 100644 index de82710..0000000 --- a/src/conf/mapbox/MCBaseMap.js +++ /dev/null @@ -1,184 +0,0 @@ -/** mapbox 鍦板浘basemap閰嶇疆鏂囦欢 */ -// 鑾峰彇褰撳墠椤甸潰ip鍦板潃鍜岀鍙� -const curWwwPath = window.document.location.href -const pathname = window.document.location.pathname -const pos = curWwwPath.indexOf(pathname) -const HOST_URL = curWwwPath.substring(0, pos) -const SINOPEC_GIS_HOST = 'http://10.246.132.249:8080' // 鍐呯綉澶╁湴鍥句富鏈哄湴鍧� -const TDT_GIS_HOST = 'http://t0.tianditu.gov.cn' // 鍏綉澶╁湴鍥句富鏈哄湴鍧� -const TDT_GIS_TOKEN = '5d76218063082952d18b76da5005f490' // 澶囩敤tk: f1b72b5e7cb1175acddfa485f1bc9770 -export default { - TokenConfig: { - IsLoadTDTByToken: true, // 鏄惁浣跨敤鍐呯綉鍦板浘 - TokenOption: { - url: SINOPEC_GIS_HOST + '/RemoteTokenServer', // 鑾峰彇token鐨勬湇鍔℃帴鍙� - option: { - request: 'getToken', - username: 'sipms', // 鑾峰彇token鐨勭敤鎴峰悕 - password: 'sinopecipms', // 鑾峰彇token鐨勫瘑鐮� - expiration: 1440, - clientid: 'ref.' + HOST_URL// 鑾峰彇token鐨勫簲鐢ㄦ湇鍔″櫒鍦板潃 - } - } - }, - BaseMap: { - IntranetTDT: [ - { - name: '褰卞儚鍦板浘', - visibility: 'visible', // 鍥惧眰鏄剧ず闅愯棌 2 绉嶇姸鎬� visible none - isAddToMap: true, - source: { - type: 'raster', - tileSize: 256, - tiles: [ - SINOPEC_GIS_HOST + '/OneMapServer/rest/services/base-tdt-image-globe/WMTS?' + - 'layer=img&style=default&tilematrixset=c&Service=WMTS&Request=GetTile&Version=1.0.0&Format=tiles&TileMatrix={z}&TileCol={x}&TileRow={y}' - ] - }, - layer: { - id: 'img_c', // 鍥惧眰id锛岃淇濊瘉鍞竴鎬� - type: 'raster', // 鍥惧眰绫诲瀷 - source: 'img_c', // 鏁版嵁婧� 鍜� source 瀹炰緥鍖栧悗鐨勭殑璇锋眰鍚嶇О淇濇寔涓�鑷撮渶瑕佹敞鎰� - minzoom: 0, // 鍥惧眰鏈�灏忕缉鏀剧骇鏁� - maxzoom: 17 // 鍥惧眰鏈�澶х缉鏀剧骇鏁� - } - }, - { - name: '褰卞儚鏍囨敞', - visibility: 'visible', // visible non - isAddToMap: true, - source: { - type: 'raster', - tileSize: 256, - tiles: [SINOPEC_GIS_HOST + '/OneMapServer/rest/services/base-tdt-label-image/WMTS?' + - 'layer=cia&style=default&tilematrixset=c&Service=WMTS&Request=GetTile&Version=1.0.0&Format=tiles&TileMatrix={z}&TileCol={x}&TileRow={y}'] - }, - layer: { - id: 'cia_c', - type: 'raster', - source: 'cia_c', - minzoom: 0, - maxzoom: 17 - } - }, - { - name: '鐭㈤噺鍦板浘', - visibility: 'visible', // visible non - isAddToMap: false, - source: { - type: 'raster', - tileSize: 256, - tiles: [SINOPEC_GIS_HOST + '/OneMapServer/rest/services/base-tdt-vector-globe/WMTS?' + - 'layer=vec&style=default&tilematrixset=c&Service=WMTS&Request=GetTile&Version=1.0.0&Format=tiles&TileMatrix={z}&TileCol={x}&TileRow={y}'] - }, - layer: { - id: 'vec_c', - type: 'raster', - source: 'vec_c', - minzoom: 0, - maxzoom: 17 - } - }, - { - name: '鐭㈤噺鏍囨敞', - visibility: 'visible', // visible non - isAddToMap: false, - source: { - type: 'raster', - tileSize: 256, - tiles: [SINOPEC_GIS_HOST + '/OneMapServer/rest/services/base-tdt-label-vector/WMTS?' + - 'layer=cva&style=default&tilematrixset=c&Service=WMTS&Request=GetTile&Version=1.0.0&Format=tiles&TileMatrix={z}&TileCol={x}&TileRow={y}'] - }, - layer: { - id: 'cva_c', - type: 'cva_c', - source: 'cva_c', - minzoom: 0, - maxzoom: 17 - } - } - ], - - InternetTDT: [ - { - name: '褰卞儚鍦板浘', - visibility: 'visible', // 鍥惧眰鏄剧ず闅愯棌 2 绉嶇姸鎬� visible none - isAddToMap: true, - source: { - type: 'raster', - tileSize: 256, - tiles: [ - TDT_GIS_HOST + '/img_c/wmts?layer=img&style=default&tilematrixset=c' + - '&Service=WMTS&Request=GetTile&Version=1.0.0&Format=tiles&TileMatrix={z}&TileCol={x}&TileRow={y}' + - '&tk=' + TDT_GIS_TOKEN - ] - }, - layer: { - id: 'img_c', // 鍥惧眰id锛岃淇濊瘉鍞竴鎬� - type: 'raster', // 鍥惧眰绫诲瀷 - source: 'img_c', // 鏁版嵁婧� 鍜� source 瀹炰緥鍖栧悗鐨勭殑璇锋眰鍚嶇О淇濇寔涓�鑷撮渶瑕佹敞鎰� - minzoom: 0, // 鍥惧眰鏈�灏忕缉鏀剧骇鏁� - maxzoom: 17 // 鍥惧眰鏈�澶х缉鏀剧骇鏁� - } - }, - { - name: '褰卞儚鏍囨敞', - visibility: 'visible', // visible non - isAddToMap: true, - source: { - type: 'raster', - tileSize: 256, - tiles: [TDT_GIS_HOST + '/cia_c/wmts?layer=cia&style=default&tilematrixset=c' + - '&Service=WMTS&Request=GetTile&Version=1.0.0&Format=tiles&TileMatrix={z}&TileCol={x}&TileRow={y}' + - '&tk=' + TDT_GIS_TOKEN] - }, - layer: { - id: 'cia_c', - type: 'raster', - source: 'cia_c', - minzoom: 0, - maxzoom: 17 - } - }, - { - name: '鐭㈤噺鍦板浘', - visibility: 'visible', // visible non - isAddToMap: false, - source: { - type: 'raster', - tileSize: 256, - tiles: [TDT_GIS_HOST + '/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=' + TDT_GIS_TOKEN] - }, - layer: { - id: 'vec_c', - type: 'raster', - source: 'vec_c', - minzoom: 0, - maxzoom: 17 - } - }, - { - name: '鐭㈤噺鏍囨敞', - visibility: 'visible', // visible non - isAddToMap: false, - source: { - type: 'raster', - tileSize: 256, - tiles: [TDT_GIS_HOST + '/cva_c/wmts?layer=cva&style=default&tilematrixset=c' + - '&Service=WMTS&Request=GetTile&Version=1.0.0&Format=tiles&TileMatrix={z}&TileCol={x}&TileRow={y}' + - '&tk=' + TDT_GIS_TOKEN] - }, - layer: { - id: 'cva_c', - type: 'cva_c', - source: 'cva_c', - minzoom: 0, - maxzoom: 17 - } - } - ] - } - -} diff --git a/src/conf/mapbox/MCVectorTile.js b/src/conf/mapbox/MCVectorTile.js deleted file mode 100644 index dd163b2..0000000 --- a/src/conf/mapbox/MCVectorTile.js +++ /dev/null @@ -1,89 +0,0 @@ -/** mapbox 鍦板浘閰嶇疆鏂囦欢 */ -export default [ - { - name: '鍗椾含鐭冲寲绠$綉', - visibility: 'visible', // 鍥惧眰鏄剧ず闅愯棌 2 绉嶇姸鎬� visible none - isAddToMap: true, - source: { - type: 'vector', // 鐭㈤噺绫诲瀷 - scheme: 'tms', - zoomOffset: -1, // 缁忕含搴﹀ぉ鍦板浘 闇�瑕亃oomOffset -1 - tiles: [ - // 鑾峰彇GeoServer 鐭㈤噺鍒囩墖鏈嶅姟,鍙互鏄竴涓嬪嚑绉嶆柟寮� - 'http://localhost:8080/vector/tile/{z}/{x}/{y}' // postgis 鏁版嵁搴� - // "http://xearth.cn:6213/geoserver/gwc/service/tms/1.0.0/vectory_tile%3Acontrolpoint@EPSG%3A4326@pbf/{z}/{x}/{y}.pbf" //geoserver - ] - }, - layer: { - id: 'vectorTilePoint', - type: 'circle', // 鏌ョ湅 鏁版嵁婧愮殑绫诲瀷 鍙傝�僲apbox 鐭㈤噺鏁版嵁鍙彁渚涚殑鍙傛暟绫诲瀷 - source: 'vectorTilePoint', - 'source-layer': 'points', // 鐭㈤噺鏁版嵁 濡傛灉鍖呭惈 澶氱鍥惧眰鏁版嵁 閫氳繃 杩欎釜鎸囧畾 鏁版嵁鍚嶇О - // "source-layer": "controlpoint", - minzoom: 0, - maxzoom: 18, - // "paint": { - // "circle-radius": 10, - // "circle-color": "#3887be" - // - // } - paint: { - 'circle-radius': { - stops: [ - [8, 0.1], - [11, 0.5], - [15, 3], - [20, 30] - ] - }, - 'circle-color': { - // property: 'v', - stops: [ - [1, '#990055'], - [2, '#cdb640'] - ] - - }, - 'circle-opacity': 1 - } - } - }, - { - name: '鍗椾含寤虹瓚', - visibility: 'visible', // 鍥惧眰鏄剧ず闅愯棌 2 绉嶇姸鎬� visible none - isAddToMap: true, - source: { - type: 'vector', - scheme: 'tms', - zoomOffset: -1, // 蹇呴』瑕� 缁忕含搴﹀ぉ鍦板浘 鍏朵粬鍥惧眰闇�瑕亃oomOffset -1 - tiles: ['http://xearth.cn:6213/geoserver/gwc/service/tms/1.0.0/vectory_tile%3Abuildings@EPSG%3A4326@pbf/{z}/{x}/{y}.pbf'] - }, - layer: { - id: 'builds', - source: 'buildings', - 'source-layer': 'buildings', - filter: ['==', 'extrude', 'true'], - type: 'fill-extrusion', - minzoom: 15, - paint: { - - 'fill-extrusion-color': - [ - 'interpolate', - ['linear'], - ['get', 'height'], // 灞炴�у瓧娈� - 0, 'rgb(255, 255, 191)', - 75, 'rgb(253, 174, 97)', - 150, 'rgb(215,25,28)' - ], - 'fill-extrusion-height': [ - 'interpolate', ['linear'], ['zoom'], - 15, 0, - 15.05, ['get', 'height'] - ], // 灞炴�у瓧娈� - 'fill-extrusion-opacity': - 0.8 - } - } - } -] diff --git a/src/conf/mapbox/MCWMS.js b/src/conf/mapbox/MCWMS.js deleted file mode 100644 index 1defbd8..0000000 --- a/src/conf/mapbox/MCWMS.js +++ /dev/null @@ -1,25 +0,0 @@ -/** mapbox 鍦板浘閰嶇疆鏂囦欢 */ -export default [ - { - name: 'wms鍥惧眰1', - visibility: 'visible', // 鍥惧眰鏄剧ず闅愯棌 2 绉嶇姸鎬� visible none - isAddToMap: true, - source: { - type: 'raster', - tiles: [ - 'http://xearth.cn:6289/server/ogcserver/PipeLine/wms?' + - 'version=1.1.1&service=WMS&request=GetMap&layers=all&styles=&format=image%2Fpng&transparent=true&version=1.1.1&' + - 'width=256&height=256&srs=EPSG%3A4326&bbox={bbox-epsg-4490}' - ], - tileSize: 256, - zoomOffset: -1 - }, - layer: { - id: 'wms', - type: 'raster', - source: 'wms', - minzoom: 0, - maxzoom: 17 - } - } -] diff --git a/src/conf/mapbox/MCWMTS.js b/src/conf/mapbox/MCWMTS.js deleted file mode 100644 index cb10288..0000000 --- a/src/conf/mapbox/MCWMTS.js +++ /dev/null @@ -1,22 +0,0 @@ -/** mapbox 鍦板浘閰嶇疆鏂囦欢 */ -export default [ - { - name: '鍥界晫', - visibility: 'visible', // 鍥惧眰鏄剧ず闅愯棌 2 绉嶇姸鎬� visible none - isAddToMap: true, - source: { - type: 'raster', - tiles: [ - 'http://xearth.cn:6299/server/ogcserver/whp_guojie/wmts?x={x}&y={y}&z={z}' - ], - tileSize: 256 - }, - layer: { - id: 'guojie', - type: 'raster', - source: 'guojie', - minzoom: 0, - maxzoom: 17 - } - } -] diff --git a/src/conf/mapbox/MConfig.js b/src/conf/mapbox/MConfig.js deleted file mode 100644 index 481a4a4..0000000 --- a/src/conf/mapbox/MConfig.js +++ /dev/null @@ -1,20 +0,0 @@ -/** mapbox 鍦板浘閰嶇疆鏂囦欢 */ -import MCBaseMap from '@/conf/mapbox/MCBaseMap' -import MCWMTS from '@/conf/mapbox/MCWMTS' -import MCVectorTile from '@/conf/mapbox/MCVectorTile' -import MCWMS from '@/conf/mapbox/MCWMS' -const mapOptions = { - center: [118.7843, 32.2221], // 鍦板浘涓績鐐� - zoom: 13, // 鍦板浘褰撳墠缂╂斁绾ф暟 - maxZoom: 16 -} -export default { - mapOptions: mapOptions, - TokenConfig: MCBaseMap.TokenConfig, // 鏄惁閫氳繃token鍔犺浇鍦板浘 - layers: { - BaseMap: MCBaseMap.BaseMap, - WMTS: MCWMTS, - VectorTile: MCVectorTile, - wms: MCWMS - } -} diff --git a/src/main.js b/src/main.js index e609408..fa37006 100644 --- a/src/main.js +++ b/src/main.js @@ -1,3 +1,4 @@ +// import 'babel-polyfill' import Vue from 'vue' import App from './App.vue' import router from './router' diff --git a/src/router/map.js b/src/router/map.js index 323d3a3..9372783 100644 --- a/src/router/map.js +++ b/src/router/map.js @@ -9,10 +9,8 @@ * } */ const MapTemplate = (r) => require.ensure([], () => r(require('../views/MapTemplate')), 'frame') -const MapBoxHome = r => require.ensure([], () => r(require('../views/mapbox/MapBoxHome')), 'frame') const routes = [ - { path: '/mapTemplate', name: 'MapTemplate', meta: { statusBgc: 0 }, component: MapTemplate }, - { path: '/mapboxHome', name: 'MapBoxHome', meta: { statusBgc: 0 }, component: MapBoxHome } + { path: '/mapTemplate', name: 'MapTemplate', meta: { statusBgc: 0 }, component: MapTemplate } ] // 鎵�鏈変笂闈㈠畾涔夌殑璺敱閮借鍐欏湪涓嬮潰鐨剅outes閲� diff --git a/src/views/mapbox/MapBoxHome.vue b/src/views/mapbox/MapBoxHome.vue deleted file mode 100644 index da47563..0000000 --- a/src/views/mapbox/MapBoxHome.vue +++ /dev/null @@ -1,327 +0,0 @@ -<template> - <div id="map"></div> -</template> - -<script> -// 寮曞叆缁勪欢 -import MConfig from '@/conf/mapbox/MConfig' -const mapboxgl = require('@cgcs2000/mapbox-gl') -export default { - name: 'MapBoxHome', - data () { - return { - IsLoadTDTByToken: MConfig.TokenConfig.IsLoadTDTByToken - } - }, - mounted () { - // if (this.IsLoadTDTByToken) { - // this.requireToken() - // return - // } - this.initmap() - }, - methods: { - async requireToken () { - // const param = MConfig.TokenConfig.TokenOption - // let token = await - }, - initmap () { - // const layers = MConfig.layers - // for (const item in layers) { - // const groupLayer = layers[item] - // for (const itm in groupLayer) { - // console.log(groupLayer[itm]) - // } - // } - // layers.forEach((item) => { - // item.forEach((itm) => { - // console.log(itm) - // }) - // }) - var vecUrl = 'http://t0.tianditu.com/img_c/wmts?tk=5d76218063082952d18b76da5005f490' - var cvaUrl = 'http://t0.tianditu.com/cia_c/wmts?tk=5d76218063082952d18b76da5005f490' - var tdtVec = { - // 绫诲瀷涓烘爡鏍肩摝鐗� - type: 'raster', - tiles: [ - // 璇锋眰鍦板潃 - // vecUrl + "&SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=vec&STYLE=default&TILEMATRIXSET=c&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&FORMAT=tiles" - vecUrl + '&SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=img&STYLE=default&TILEMATRIXSET=c&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&FORMAT=tiles' - ], - // 鍒嗚鲸鐜� - tileSize: 256 - } - var tdtCva = { - type: 'raster', - tiles: [ - // cvaUrl + "&SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cva&STYLE=default&TILEMATRIXSET=c&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&FORMAT=tiles" - cvaUrl + '&SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cia&STYLE=default&TILEMATRIXSET=c&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&FORMAT=tiles' - ], - tileSize: 256 - } - // wmts妯″潡 - var wmts = { - type: 'raster', - tiles: [ - 'http://xearth.cn:6299/server/ogcserver/whp_guojie/wmts?x={x}&y={y}&z={z}' - ], - tileSize: 256 - // , - // zoomOffset: -1 - } - - const buildings = { - type: 'vector', - scheme: 'tms', - zoomOffset: -1, // 蹇呴』瑕� 缁忕含搴﹀ぉ鍦板浘 鍏朵粬鍥惧眰闇�瑕亃oomOffset -1 - tiles: ['http://xearth.cn:6213/geoserver/gwc/service/tms/1.0.0/vectory_tile%3Abuildings@EPSG%3A4326@pbf/{z}/{x}/{y}.pbf'] - } - // var wms ={ - // "type": "raster", - // 'tiles': [ - // 'http://xearth.cn:6289/server/ogcserver/PipeLine/wms?' + - // 'version=1.1.1&service=WMS&request=GetMap&layers=all&styles=&format=image%2Fpng&transparent=true&version=1.1.1&' + - // 'width=256&height=256&srs=EPSG%3A4326&bbox={bbox-epsg-4490}' - // ], - // 'tileSize': 256, - // 'zoomOffset': -1 - // - // } - // 鐭㈤噺鐡︾墖妯″潡 - var test = { - // 鐭㈤噺绫诲瀷 - type: 'vector', - // 鏈嶅姟绫诲瀷 tms锛岃浣跨敤wmts鏈嶅姟璇锋崲鎴恮mts - scheme: 'tms', - zoomOffset: -1, // 蹇呴』瑕� 缁忕含搴﹀ぉ鍦板浘 鍏朵粬鍥惧眰闇�瑕亃oomOffset -1 - tiles: [ - // 鑾峰彇GeoServer 鐭㈤噺鍒囩墖鏈嶅姟,鍙互鏄竴涓嬪嚑绉嶆柟寮� - 'http://localhost:8080/vector/tile/{z}/{x}/{y}' // postgis 鏁版嵁搴� - // 'http://xearth.cn:6213/geoserver/gwc/service/tms/1.0.0/vectory_tile%3Acontrolpoint@EPSG%3A4326@pbf/{z}/{x}/{y}.pbf' // geoserver - ] - } - var geojson = { - type: 'FeatureCollection', - features: [{ - type: 'Feature', - geometry: { - type: 'Point', - coordinates: [118.759, 32.214] - }, - properties: { - title: '鐐�1', - description: '鐐�1娴嬭瘯' - } - }, - { - type: 'Feature', - geometry: { - type: 'Point', - coordinates: [118.775, 32.214] - }, - properties: { - title: '鐐�2', - description: '鐐�2娴嬭瘯' - } - }] - } - // mapboxgl.accessToken = 'pk.eyJ1IjoiYXR0dWluZyIsImEiOiJjamNham4ycTgwZzVkMndzM2lzYTJtN2VjIn0.kB9yWdGNuo7_oi3brXX4-A'; - // 瀹炰緥鍖朚ap鍦板浘瀵硅薄 - var map = new mapboxgl.Map({ - // 鍦板浘瀹瑰櫒div鐨刬d - container: 'map', - style: { - // 璁剧疆鐗堟湰鍙凤紝涓�瀹氳璁剧疆 - version: 8, - glyphs: 'http://http://xearth.cn:6213/sgis-assets/fonts/{fontstack}/{range}.pbf', - // 娣诲姞鏉ユ簮 - sources: { - tdtVec: tdtVec, - tdtCva: tdtCva, - wmts: wmts, - buildings: buildings, - // "wms":wms, - test: test, - anno: test - }, - layers: [ - { - // 鍥惧眰id锛岃淇濊瘉鍞竴鎬� - id: 'tdtVec', - // 鍥惧眰绫诲瀷 - type: 'raster', - // 鏁版嵁婧� - source: 'tdtVec', - // 鍥惧眰鏈�灏忕缉鏀剧骇鏁� - minzoom: 0, - // 鍥惧眰鏈�澶х缉鏀剧骇鏁� - maxzoom: 17 - }, - { - id: 'tdtCva', - type: 'raster', - source: 'tdtCva', - minzoom: 0, - maxzoom: 17 - }, - { - id: 'wmts', - type: 'raster', - source: 'wmts', - minzoom: 0, - maxzoom: 17 - }, - { - id: 'builds', - source: 'buildings', - 'source-layer': 'buildings', - type: 'fill-extrusion', - minzoom: 15, - paint: { - 'fill-extrusion-color': - [ - 'interpolate', - ['linear'], - ['get', 'height'], // 灞炴�у瓧娈� - 0, 'rgb(255, 255, 191)', - 75, 'rgb(253, 174, 97)', - 150, 'rgb(215,25,28)' - ], - 'fill-extrusion-height': [ - 'interpolate', ['linear'], ['zoom'], - 15, 0, - 15.05, ['get', 'height'] - ], // 灞炴�у瓧娈� - 'fill-extrusion-opacity': - 0.7 - } - }, - // { - // "id": "wms", - // "type": "raster", - // "source": "wms", - // "minzoom": 0, - // "maxzoom": 17 - // }, - { - id: 'test', - type: 'circle', - source: 'test', - 'source-layer': 'points', - // 'source-layer': 'controlpoint', - minzoom: 0, - maxzoom: 18, - // "paint": { - // "circle-radius": 10, - // "circle-color": "#3887be" - // - // } - paint: { - 'circle-radius': { - stops: [ - [8, 0.1], - [11, 0.5], - [15, 3], - [20, 30] - ] - }, - 'circle-color': { - // property: 'measattribute', - stops: [ - [1, '#990055'], - [2, '#cdb640'] - ] - - }, - 'circle-opacity': 1 - } - }, - { - // 閮婂尯 - id: 'anno', - type: 'symbol', - source: 'anno', - 'source-layer': 'points', - minzoom: 14, - maxzoom: 17, - // filter: [ - // '==', - // 'fclass', - // 'suburb' - // ], - layout: { - 'text-field': '{measattribute}', - // 'text-transform': 'uppercase', - 'text-font': [ - // 杩欎釜灏辨槸{fontstack}锛屼篃灏辨槸瀛椾綋鏂囦欢澶圭殑鍚嶇О - 'Microsoft YaHei Regular' - ], - 'text-letter-spacing': 0.15, - 'text-max-width': 7, - 'text-padding': 3, - 'text-size': { - base: 1, - stops: [ - [ - 11, - 11 - ], - [ - 15, - 18 - ] - ] - } - }, - paint: { - 'text-halo-color': 'hsl(0, 0%, 100%)', - 'text-halo-width': 1, - 'text-color': 'hsl(230, 29%, 35%)', - 'text-halo-blur': 0.5 - }, - interactive: true - } - ] - }, - // 鍦板浘涓績鐐� - center: [118.7843, 32.2221], - // 鍦板浘褰撳墠缂╂斁绾ф暟 - zoom: 13, - maxZoom: 16 - }) - // 瀹炰緥鍖栧鑸帶浠� - var nav = new mapboxgl.NavigationControl( - { - // 鏄惁鏄剧ず鎸囧崡閽堬紝榛樿涓簍rue - showCompass: true, - // 鏄惁鏄剧ず缂╂斁鎸夐挳锛岄粯璁や负true - showZoom: true - } - ) - // 娣诲姞瀵艰埅鎺т欢锛屾帶浠剁殑浣嶇疆鍖呮嫭'top-left', 'top-right','bottom-left' ,'bottom-right'鍥涚锛岄粯璁や负'top-right' - map.addControl(nav, 'top-left') - // map.on('click', function (e) { - // console.log(e) - // }) - map.on('click', 'test', function (e) { - if (e.defaultPrevented) { - return - } - e.preventDefault() - console.log(e) - console.log(e.features) - }) - console.log(geojson) - } - } -} -</script> - -<style scoped> -#map{ - position: absolute; - top: 0; - bottom: 0; - width: 100%; -} -</style> diff --git a/vue.config.js b/vue.config.js index 869164e..be07b5a 100644 --- a/vue.config.js +++ b/vue.config.js @@ -17,8 +17,8 @@ parallel: require('os').cpus().length > 1, // 鏋勫缓鏃跺紑鍚杩涚▼澶勭悊babel缂栬瘧 productionSourceMap: false, devServer: { - host: 'localhost', - open: true, + // host: 'localhost', + // open: true, port: 8888, // overlay: false, overlay: { -- Gitblit v1.8.0