Class: searchViewModel

searchViewModel

The Layer query component function class.

L.supermap.components.searchViewModel(map, options)

SearchViewModel.js, line 11
Name Type Description
map L.Map

The Leaflet Map object.

options Object

Optional paramerters.

Name Type Description
cityGeoCodingConfig Object optional

The city address matching service configuration, including: {addressUrl:"", key:""},defaults to the online address matching service, corresponding to options.cityConfig.

Version:
  • 9.1.1
Fires

Extends

searchViewModel -> L.Evented

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
result Object

The data returned after the city matches successfully.

newlayeradded

SearchViewModel.js, line 150

Add a query layer event

Properties:
Name Type Description
result Object

The new layer object returned by the event.

layerName string

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
searchType string

Layer attribute query status.

searchlayersucceeded

SearchViewModel.js, line 85

Triggered after the layer attribute query succeeds.

Properties:
Name Type Description
result Object

Layer data.

Methods

addSearchLayers(layers)

SearchViewModel.js, line 143

Add a new queryable layer.

Name Type Description
layers Array.<L.GeoJSON>

The newly added layer object.

panToCity(city)

SearchViewModel.js, line 173

Zoom to the specified city.

Name Type Description
city string

Specifies the city name to be scaled.

panToLayer(layerName)

SearchViewModel.js, line 162

Zoom to the specified layer.

Name Type Description
layerName string

Specifies the name of the layer to be scaled.

SearchViewModel.js, line 61

Inquire.

Name Type Description
keyWord string

The keyword of the query.

searchLayerName string 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
keyWords string

The keywords for the city address matching query.

searchFromLayer(searchLayerName, keyWord)

SearchViewModel.js, line 75

Layer attribute query.

Name Type Description
searchLayerName string

The name of the layer being queried.

keyWord string

Layer attribute search keyword.