L.supermap.components.searchViewModel(map, options)
| Name | Type | Description | ||||||
|---|---|---|---|---|---|---|---|---|
map |
L.Map |
The Leaflet Map object. |
||||||
options |
Object |
Optional paramerters.
|
- Version:
- 9.1.1
Fires
Extends
Members
-
mapL.Map
-
The map where the current component is located.
Events
-
geocodesucceeded
SearchViewModel.js, line 112 -
Triggered after the city address is successfully matched.
Properties:
Name Type Description resultObject The data returned after the city matches successfully.
-
newlayeradded
SearchViewModel.js, line 150 -
Add a query layer event
Properties:
Name Type Description resultObject The new layer object returned by the event.
layerNamestring The name of the new layer object returned by the event.
-
searchfailed
SearchViewModel.js, line 92 -
Fires when the layer attribute query fails.
Properties:
Name Type Description searchTypestring Layer attribute query status.
-
searchlayersucceeded
SearchViewModel.js, line 85 -
Triggered after the layer attribute query succeeds.
Properties:
Name Type Description resultObject Layer data.
Methods
-
addSearchLayers(layers)
SearchViewModel.js, line 143 -
Add a new queryable layer.
Name Type Description layersArray.<L.GeoJSON> The newly added layer object.
-
panToCity(city)
SearchViewModel.js, line 173 -
Zoom to the specified city.
Name Type Description citystring Specifies the city name to be scaled.
-
panToLayer(layerName)
SearchViewModel.js, line 162 -
Zoom to the specified layer.
Name Type Description layerNamestring Specifies the name of the layer to be scaled.
-
search(keyWord, searchLayerName)
SearchViewModel.js, line 61 -
Inquire.
Name Type Description keyWordstring The keyword of the query.
searchLayerNamestring optional Execute the query type, execute the vector layer attribute query, and perform the address matching when it is "geocode".
-
searchFromCityLocalSearchService(keyWords)
SearchViewModel.js, line 104 -
City address matching query.
Name Type Description keyWordsstring The keywords for the city address matching query.
-
searchFromLayer(searchLayerName, keyWord)
SearchViewModel.js, line 75 -
Layer attribute query.
Name Type Description searchLayerNamestring The name of the layer being queried.
keyWordstring Layer attribute search keyword.