A control that adds interactive geocoding functionality to the map. Geocoded locations will have markers set to their locations. If enabled, the Search Ahead API will provide predictive results based on the provided input.
var map = new mqgl.Map('map', 'KEY', {
controls: {
geocoding: {
closeResultsOnClick: true,
compactResults: false,
enabled: true,
keepOpen: false,
position: 'topleft',
searchAhead: true,
searchAheadOptions: {
limit: 6
},
}
}
});
An object containing any of the following key value options: closeResultsOnClick, compactResults, enabled, keepOpen, position, searchAhead, and searchAheadOptions.
Determines if Search Ahead results should automatically close when a result is selected.
Determines if a compact version of Search Ahead results should be used.
Determines if this control should be displayed.
Determines if input field of the control should remain open after a geocode.
The position of the control (one of the map corners).
Possible values are 'topleft', 'topright', 'bottomleft' or 'bottomright'.
Determines if the Search Ahead functionality should be enabled on the control.
If the open
option is set to true
, this feature will automatically be disabled.
Options to be passed into the Search Ahead API if it is enabled.
Any Request Parameters of the Search Ahead API are valid options.
If the location
parameter is not set in this object, Search Ahead results will be based on the current map center.
controls: {
geocoding: {
closeResultsOnClick: true,
compactResults: false,
enabled: true,
keepOpen: false,
position: 'topleft',
searchAhead: true,
searchAheadOptions: {
limit: 6
},
}
}
}