#header-mark#
Search Control
基础用法
API
属性
| 属性名 | 说明 | 类型 | 默认值 |
|---|---|---|---|
| position | 控件位置 | enum | 'topleft' |
| url | 用于搜索查询的URL | string | - (必填) |
| layer | 用于搜索查询的图层组 | LayerGroup | null |
| zoom | 移动到搜索位置后的缩放级别,默认不改变缩放级别 | number | null |
| found_style | 在图层组中搜索时,搜索到要素的样式 | object | {'fillColor': '#3f0', 'color': '#0f0'} |
| property_name | 用于显示的属性名称 | string | 'display_name' |
| auto_complete | 是否启用自动补全功能 | boolean | true |
事件
| 事件名 | 说明 | 参数类型 |
|---|---|---|
| feature_found | 当要素被找到时触发 | - |
| location_found | 当位置被找到时触发 | - |
插槽
| 插槽名 | 说明 |
|---|---|
| default | 用于自定义标记(marker)内容 |
方法
| 方法名 | 说明 | 参数 | 返回值 |
|---|---|---|---|
| - | - | - | - |
src/examples/vleaflet/controls/Search