绘制风速图标
使用示例
下载示例中的:windGeojsonData
const layer = hnsdk.drawWind(grid)
layer.addTo(map)
Creation
| 构造函数 | 说明 |
|---|---|
| hnsdk.drawWind(geojsonData) | 给出一个LayerGroup对象,通过传递 geojson 格式的经纬度点数据绘制风速图标 |
Options 选项
| 选项 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| geojsonData | Object | 必填 | geojson FeatureCollection 格式的 经纬点数据 每个点中的 properties 中有必填的 speed 、deg 字段 speed 是风速 deg 是 风向 0 - 360 |
Events 事件
Methods 方法
| 方法名 | 返回值 | 说明 |
|---|---|---|
toGeoJSON(precision?) | Object | 坐标值使用具有指定 |
addLayer(layer) | this | 将给定的图层添加到组中。 |
removeLayer(layer) | this | 将给定的图层从组中移除。 |
removeLayer( id) | this | 将具有给定内部ID的图层从组中移除。 |
hasLayer(layer) | Boolean | 如果给定的图层当前被添加到组中,则返回 |
hasLayer( id) | Boolean | 如果给定的内部 ID 当前被添加到组中,则返回 |
clearLayers() | this | 移除组中的所有图层。 |
invoke( methodName, …) | this | 对该组中包含的每个图层调用 |
eachLayer( fn, context?) | this | 遍历该组的各图层,可以选择指定迭代器函数的上下文。 |
getLayer( id) | Layer | 返回具有给定内部 ID 的图层。 |
getLayers() | Layer[] | 返回所有添加到组中的图层的数组。 |
setZIndex( zIndex) | this | 对包含在该组中的每个图层调用 |
getLayerId(layer) | Number | 返回一个图层的内部 ID |
