派生自 wuyushui/SewerAndRainNetwork

YANGDL
2021-01-16 b4586cdc2a23443a1bdafd2ec19fb3514e541905
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
            }
          ]
        },