Skip to content

PolygonFeature ​

PolygonFeature ​

多边形要素类

继承BaseFeature

Examples ​

javascript
const polygonFeature = new DiMap.PolygonFeature({
  geoData: [
    [
      [116.405467, 39.907761],
      [116.415467, 39.917761],
      [116.425467, 39.927761],
      [116.435467, 39.937761]
    ]
  ],
  fillColor: "#f60",
  fillOpacity: 1,
  fillOutlineColor: "#000",
  fillZIndex: 1
})
const polygonLayer = new DiMap.PolygonLayer()
polygonFeature.addToLayer(polygonLayer)
polygonLayer.addToMap(map)

constructor ​

Parameters ​

参数名必选类型描述
opts是PolygonFeatureOptions多边形要素属性
userData否Record<string, any>用户自定义数据,默认值为 {}

PolygonFeatureOptions ​

多边形要素属性

Properties ​

参数名必选类型描述
fillColor否string多边形填充颜色
fillOpacity否number多边形填充透明度
fillOutlineColor否string多边形边框颜色
fillZIndex否number优先级