* | ALKMaps.Control |
ALKMaps. | |
Properties | |
events | {ALKMaps.Events} |
componentLocation | Possible values like “topleft”, “topright”, “bottomright”, “bottomleft”. |
componentWidth | Possible values like “narrow”, “wide”. |
div | Div containing the control. |
doneTypingInterval | {Number} Done typing interval. |
placeholderText | {String} Place holder text for the search box. |
minSearchTextLength | {Number} If search text is longer than this value, then starts search. |
Constants | |
DEFAULT_SEARCH_OPTION | {Object} Default search settings. |
Properties | |
searchOption | {Object} Search option. |
locationRelevance | {String} Map viewport center or device location may be used. |
hideResults | {Boolean} Hide results list or not when a result item is clicked on or enter key is pressed on a focused item. |
geocodingLayer | {ALKMaps.Layer.VectorMarkers} Location marker will be drawn on this layer. |
classNamePrefix | {String} CSS class name prefix. |
markerStyle | {Object} Marker style. |
markerConfig | {Object} Location marker configuration. |
popupConfig | {Object} Popup property configuration. |
displaySystem | {String} Show distance in KM or Miles. |
Functions | |
destroy | Destroy control. |
activate | Activates the control. |
deactivate | Deactivates the control. |
setMap | Sets map and the geocoding layer to the map. |
draw | Draws the control. |
createResultElement | Construct HTML LI item. |
setSearchOption | Updates search option. |
searchCompleted | Default method for handling successful search. |
searchFailed | Default method for handling failed search. |
locationfailed | trigged when browser’s geolocation failed. It can be caused by HTTPS is not enabled. The event object will include a error property that references the error. |
searchcompleted | triggered when the control receives results from the single search web service before the control starts to show results. The event object will include a locations property that references the results. When a listener returns “false”, the step of showing results list will be skipped. |
resultslistdrawn | triggered after results list is shown. The event object will include a locations property that reference the search results. By adding a listener, user may be able to frame locations on the map as an example. |
locationclick | triggered when user clicks on a location item on the displayed results list. The event object will include a location property that references the location. When a listener returns “false”, the step of showing the location marker on the map will be aborted. |
locationenter | triggered when user presses enter key if the location item has the focus. The event object will include a location property that references the location. When a listener returns “false”, the step of showing the location marker on the map will be aborted. |
resultslistescape | triggered when ESC key is pressed if any location item has the focus. The event object will include a resultsListElement property that references the UL DOM element. When a listener returns “false”, the step of hiding results list process will be aborted. |
beforeprocessresponseitem | trigged before a location marker with an optional popup is added to the map. The event object will include a location property that references the location. When a listener returns “false”, the step of showing the location marker on the map will be aborted. By handling this event, user does not need to handle locationclick and locationenter separately. |
locationblur | triggered when a location item in the displayed list loses focus. The event object will include a location property that references the location. When a listener returns “false”, the activate keyboard control process will be aborted. |
locationfocus | triggered when a location item in the displayed list gets focus. The event object will include a location property that references the location. When a listener returns “false”, the deactivate keyboard control process will be aborted. |
beforegeticon | triggered when showing location results list or showing location marker on the map. The event object will include a location property that references the location. If a listener returns an icon path, this icon will be used instead of the application default icon. Be aware that if markerStyle.externalGraphic is supplied, it will be used to draw the location marker. |
{Object} Search option.
query | {String} If it is not null, search text box input will be ignored. |
maxResults | {Number} Maximum returned results. Default is 20. |
currentLonLat | {ALKMaps.LonLat} Current longitude and latitude values in degrees. If it is supplied, it has higher priority. If not, the reference longitude and latitude will be based on the locationRelevance setting. |
excludedSearchTypes | {String} Comma-separated list of types to exclude from the search. Default is “POI,POITYPE”. To get all types, you can call ALKMaps.Geocoder.singleSearchGet(‘types’) method. |
poiCategories | {String} Comma-separated list of poi category names by which you want to filter all POI results. To get all categories, you can call ALKMaps.Geocoder.singleSearchGet(‘poiCategories’) method. |
countries | {String} Comma-separated list of country abbreviations by which you want to filter all results. To get all countries, you can call ALKMaps.Geocoder.singleSearchGet(‘countries’) method. |
countryType | {String} ISO, FIPS, GENC2, GENC3. To get all types, you can call ALKMaps.Geocoder.singleSearchGetCountryTypes() method. |
states | {String} Comma-separated list of state abbreviations by which you want to filter all results. To get all states, you can call ALKMaps.Geocoder.singleSearchGet(‘states’) method. |
region | {String} NA, EU, WW. To get supported regions, you can call ALKMaps.Geocoder.singleSearchGetRegions() method. |
async | {Boolean} Open an asynchronous request. Default is true. |
success | {Function} To overwrite default handler, supply custom method here. |
failure | {Function} To overwrite default handler, supply custom method here. |
{ALKMaps.Layer.VectorMarkers} Location marker will be drawn on this layer.
{Object} Marker style. When you create an instance of this control, setup this property. Changing this property after initialization may cause undesired effects.
externalGraphic | {String} If the URL is supplied, it will replace default icon. Default is null and the control will choose icon for the marker. |
graphicHeight | {Number} Marker height. Default is 26 pixel. |
graphicWidth | {Number} Marker width. Default is 26 pixel. |
graphicXOffset | {Number} Marker x-direction offset. Default is -13. |
graphicYOffset | {Number} Marker y-direction offset. Default is -13. |
{Object} Location marker configuration. When you create an instance of this control, setup this property. Changing this property after initialization may cause undesired effects.
exclusive | {Boolean} If true, erases all other marker first. Default is true. |
centerOnMap | {Boolean} Center the marker on the map. Default is true. |
zoomLevel | {Number} Zoom level is used for centering the marker. |
{Object} Popup property configuration. When you create an instance of this control, setup this property. Changing this property after initialization may cause undesired effects.
show | {Boolean} Popup shows or not. Default is true. |
id | {String} Unique identifier. Default is null, the system assigns Id to each popup. |
displayClass | {String} CSS class name. Default is “single-search” |
size | {ALKMaps.Size} Popup size. Default is 200 * 50. |
offset | {ALKMaps.Pixel} Popup offset. Default is (0, -13). |
closeBox | {Boolean} Having a close box or not. Default is false. |
closeBoxCallback | {Function} Function to be called on closeBox click. Default is null. |
exclusive | {Boolean} If true, closes all other popups first. Default is true. |
createResultElement: function( responseItem )
Construct HTML LI item. The item can raise locationenter, resultslistescape, locationclick, locationblur, locationfocus events.
<li> <a href="#" tabindex="0">response item <div class="results-icon"> <img src='' /> </div> <div> <div> <span></span> </div> <div> <span></span> </div> <div> <span></span> </div> </div> </a> </li>
Destroy control.
destroy: function()
Activates the control.
activate: function()
Deactivates the control.
deactivate: function()
Sets map and the geocoding layer to the map.
setMap: function( map )
Draws the control.
draw: function()
Construct HTML LI item.
createResultElement: function( responseItem )
Updates search option.
setSearchOption: function( key, value )
Default method for handling successful search.
searchCompleted: function( resp )
Default method for handling failed search.
searchFailed: function( resp )