Mapbox GL JS:一层中有两个圆半径属性

时间:2019-07-15 15:41:09

标签: javascript mapbox

我正在创建一个mapbox地图,当单击一个点时,该点将被放大以显示它已被选中。另外,我想对它们进行插值,以便在缩放时改变大小。如何在一层中使用两个“圆半径”属性?

          map.addLayer({
            id: 'disdPoints',
            type: 'circle',
            source: 'campus',
            paint: {
              'circle-color': [
                'case',
                ['==', ['to-string', ['get', 'CDALLS']], '.'], '#999',
                ['==', ['to-number', ['get', 'CDALLS']], 0], '#e34e36',
                ['<=', ['to-number', ['get', 'CDALLS']], 59], '#e34e36',
                ['<=', ['to-number', ['get', 'CDALLS']], 69], '#ff8f24',
                ['<=', ['to-number', ['get', 'CDALLS']], 79], '#fec44f',
                ['<=', ['to-number', ['get', 'CDALLS']], 89], '#52b033',
                ['<=', ['to-number', ['get', 'CDALLS']], 100], '#329ce8',
                '#999'
              ],
              'circle-radius':
              ['case',
                ['boolean', ['feature-state', 'click'], false],
                15,
                5
              ],
              ['interpolate', ['linear'], ['zoom'],
                    2, 12],
                    13, 180],
                  ],
                  'circle-opacity': 0.8,
                  'circle-stroke-width': [
                    'case',
                    ['==', ['get', 'CFLCHART'], 'Y'], 2,
                    0
                  ],
                  'circle-stroke-color': '#000',
                  'circle-stroke-opacity': 0.5
                },
                layout: {
                  visibility: 'visible'
                }
              },
              'place_other');

0 个答案:

没有答案