Heron.widgets.search.GeocoderCombo¶
-
class
Heron.widgets.search.GeocoderCombo(config)¶
Creates a combo box that handles results from a geocoding service. By default it uses OSM Nominatim, but it can be configured with a custom store to use other services like WFS. If the user enters a valid address in the search box, the combo’s store will be populated with records that match the address. By default, records have the following fields:
name -
StringThe formatted address.- lonlat -
ArrayLocation matching address, for use with OpenLayers.LonLat.fromArray.
- lonlat -
- bounds -
ArrayRecommended viewing bounds, for use with OpenLayers.Bounds.fromArray.
- bounds -
Config Options¶
Configuration properties in addition to those listed for Ext.form.ComboBox.
-
displayField StringThe field to display in the combo boy. Default is “name” for instant use with the default store for this component.
-
emptyText StringText to display for an empty field (i18n).
-
layer OpenLayers.Layer.VectorIf provided, a marker will be drawn on this layer with the location returned by the geocoder. DISABLED: The location will be cleared when the map panned.
-
layerOpts Options for layer activation when search was successful.
-
loadingText StringText to display for an empty field (i18n).
-
locationField StringThe field to get the location from. This field is supposed to contain an array of [x, y] for a location. Default is “lonlat” for instant use with the default store for this component.
-
map GeoExt.MapPanel|OpenLayers.MapThe map that will be controlled by this GeoCoderComboBox. Only used if this component is not added as item or toolbar item to aGeoExt.MapPanel.
-
minChars NumberMinimum number of entered characters to trigger a search. Default is 3.
-
queryDelay NumberDelay before the search occurs. Default is 200ms.
-
queryParam StringThe query parameter for the user entered search text. Default is “q” for instant use with OSM Nominatim.
-
srs String|OpenLayers.ProjectionThe srs used by the geocoder service. Default is “EPSG:4326”.
-
store Ext.data.StoreThe store used for this combo box. Default is a store with a ScriptTagProxy and the url configured asurlproperty.
-
tooltip See http://www.dev.sencha.com/deploy/dev/docs/source/TextField.html#cfg-Ext.form.TextField-emptyText, default value is “Search”.
-
url StringURL template for querying the geocoding service. If astoreis configured, this will be ignored. Note that thequeryParamwill be used to append the user’s combo box input to the url. Default is “http://nominatim.openstreetmap.org/search?format=json”, for instant use with the OSM Nominatim geolocator. However, if you intend to use that, note the Nominatim Usage Policy.
-
valueField StringField from selected record to use when the combo’sgetValue()method is called. Default is “bounds”. This field is supposed to contain an array of [left, bottom, right, top] coordinates for a bounding box or [x, y] for a location.
-
zoom StringThe minimum zoom level to use when zooming to a location. If zoom < 0 then zoom to extent. Default is 10.
Public Properties¶
Public properties in addition to those listed for Ext.form.ComboBox.
-
GeocoderCombo.hideTrigger¶ Hide trigger of the combo.