#header-mark#
GeoJson
Layer created from a GeoJSON data structure.
基础用法
API
属性
属性名 | 说明 | 类型 | 默认值 | 必填 | 备注 |
---|---|---|---|---|---|
data | GeoJSON数据结构 | Object | - | 是 | 必须包含有效的GeoJSON数据 |
name | 图层名称 | string | '' | 否 | - |
style | 应用到要素的基础样式 | Object | {} | 否 | 支持Leaflet Path样式选项 |
hover_style | 鼠标悬停时的要素样式 | Object | {} | 否 | 支持Leaflet Path样式选项 |
point_style | 点要素的特殊样式 | Object | {} | 否 | 支持Leaflet Path样式选项 |
style_callback | 动态样式回调函数 | Function | null | 否 | (feature) => styleObject |
事件
事件名 | 说明 | 回调参数 |
---|---|---|
click | 要素点击事件 | { feature: GeoJSONFeature, layer: L.Layer } |
hover | 要素悬停事件 | { feature: GeoJSONFeature, layer: L.Layer } |
插槽
插槽名 | 说明 |
---|---|
- | - |
方法
方法名 | 说明 | 参数 | 返回值 |
---|---|---|---|
- | - | - | - |
src/examples/vleaflet/layers/GeoJson