Class: search

search

Layer query component.

SearchView.js, line 17
Name Type Description
options Object

Optional parameters.

Name Type Default Description
cityConfig Object | Array.<string> optional

City address matching configuration, the default is the national city, corresponding to the service supported by options.cityGeoCodingConfig; Configure two formats: {key1:{A:[],B:[]}, key2:{C:[],D:[]}} or ["Chengdu", "Beijing"], user can Configure according to your project needs.

cityGeoCodingConfig Object optional

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

isGeoCoding boolean true optional

Whether to support city address matching.

pageSize number 10 optional

Returns the number of recorded results, the maximum setting is 20.

pageNum number 1 optional

Page page number, default 1 represents the first page.

perPageDataNum number 8 optional

The number of displays per page, the maximum is 8.

position string 'topright' optional

The location where the component is displayed on the map, including: 'topleft', 'topright', 'bottomleft' and 'bottomright', inherited from leaflet control.

style function optional

Sets the default style for layer points, lines, and plygons. Point style returns maker or circleMaker; line and polygon return L.path style.

onEachFeature function optional

A function that will be called once for each created feature after the style is created and set. Used to attach events and pop-ups to features. By default, no action is taken on the newly created layer.

Version:
  • 9.1.1
Fires

Extends

search -> L.supermap.components.componentsViewBase

Events

geocodesucceeded

SearchView.js, line 498

Triggered after the data stream service successfully returns data

Properties:
Name Type Description
result Object

The GeoJSON formatted data object returned by the event.

searchfailed

SearchView.js, line 517

Fires when the layer attribute query failed.

Properties:
Name Type Description
message string

The reason for the failure.

searchlayersucceeded

SearchView.js, line 472

Triggered after the layer query succeeds.

Properties:
Name Type Description
result Object

The GeoJSON formatted data object returned by the event.

Methods

addSearchLayer(layers)

SearchView.js, line 70

Add a queryable layer.

Name Type Description
layers Array.<L.GeoJSON> | L.GeoJSON

Queryable layers.

clearSearchResult()

SearchView.js, line 644

Clear the results of the current query, etc.

inherited off(eventType, callback)

ComponentsViewBase.js, line 73

Close the event.

Name Type Description
eventType string

Listening event name.

callback function

bCallback function for listening to events.

inherited on(eventType, callback)

ComponentsViewBase.js, line 64
Name Type Description
eventType string

Type of listen event.

callback function

Callback function for listening to events.

inherited onAdd()

ComponentsViewBase.js, line 53

Add components to the basemap

inherited onAdd()

ComponentsViewBase.js, line 53

Add components to the basemap