| | |
| | | style: { |
| | | // 设置版本号,一定要设置 |
| | | version: 8, |
| | | glyphs: 'http://http://xearth.cn:6213/sgis-assets/fonts/{fontstack}/{range}.pbf', |
| | | // 添加来源 |
| | | sources: { |
| | | tdtVec: tdtVec, |
| | |
| | | wmts: wmts, |
| | | buildings: buildings, |
| | | // "wms":wms, |
| | | test: test |
| | | test: test, |
| | | anno: test |
| | | }, |
| | | layers: [ |
| | | { |
| | |
| | | }, |
| | | '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 |
| | | } |
| | | ] |
| | | }, |