From b4586cdc2a23443a1bdafd2ec19fb3514e541905 Mon Sep 17 00:00:00 2001 From: YANGDL <114714267@qq.com> Date: 星期六, 16 一月 2021 01:31:48 +0800 Subject: [PATCH] 增加mapbox插接件和功能 --- src/views/mapbox/MapBoxHome.vue | 49 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 48 insertions(+), 1 deletions(-) diff --git a/src/views/mapbox/MapBoxHome.vue b/src/views/mapbox/MapBoxHome.vue index cd99fb7..da47563 100644 --- a/src/views/mapbox/MapBoxHome.vue +++ b/src/views/mapbox/MapBoxHome.vue @@ -133,6 +133,7 @@ style: { // 璁剧疆鐗堟湰鍙凤紝涓�瀹氳璁剧疆 version: 8, + glyphs: 'http://http://xearth.cn:6213/sgis-assets/fonts/{fontstack}/{range}.pbf', // 娣诲姞鏉ユ簮 sources: { tdtVec: tdtVec, @@ -140,7 +141,8 @@ wmts: wmts, buildings: buildings, // "wms":wms, - test: test + test: test, + anno: test }, layers: [ { @@ -233,6 +235,51 @@ }, '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 } ] }, -- Gitblit v1.8.0