使用除圆之外的其他形状的样式mapbox点

时间:2018-05-23 17:35:44

标签: javascript leaflet mapbox

目前我有一个包含许多点的地图框图层,使用circle显示。有没有办法使用其他形状来定义图层而不是圆?

这就是我所拥有的:

export const gaugeLayer = fromJS({
  id: 'gauges',
  source: 'gauges',
  type: 'circle',
  interactive: true,
  minzoom: 5,
  layout: {
    visibility: 'visible',
  },
  paint: {
    'circle-radius': {
      base: 3,
      stops: [[5, 3.5], [7, 4]],
    },
    'circle-stroke-color': '#fafafa',
    'circle-stroke-width': 1,
    'circle-color': {
      property: 'classId',
      stops: [
        [1, '#f9a825'], //yellow #f9a825
        [2, '#0D47A1'], //blue #1a237e
        [3, '#03a9f4'], //light blue
        [4, '#ff6f00'], //orange Winter storm
        [5, '#F44336'],
        [6, '#087f23'], //green
        [7, '#f06292'], //pink
        [8, '#7E57C2'],
        [9, '#C51162'],
      ],
    },
  },
});

我可以使用diamond吗?或者使用不同形状的首选方式是什么?

0 个答案:

没有答案
相关问题