Closed jsomerville closed 9 years ago
RESTRICT SEARCH RANGE:
The esri.dijit.geocoder uses an object called arcgisGeocoder. This object has multiple properties to control the search processed by the ESRI World Geolocator. Use one of these three properties to restrict search results to Maryland: a.) suffix b.) searchextent c.) localsearchOptions{minscale:distance:}
Test which gives the best results.
http://help.arcgis.com/en/webapi/javascript/arcgis/jssamples/#sample/locator_suffix http://help.arcgis.com/en/webapi/javascript/arcgis/jsapi/#geocoder
Test results: a.) suffix: expects a city name. does not like using "in Maryland" b.) searchextent: initially set to a variable of esri.geometry.extent set to general bounds of state of Maryland giving web mercator spatial reference. This proves very accurate results. Type in "Columbia" and takes you to Columbia, MD, not Columbia, MS. Might want to change to webmapExtent, or make extent and spatial reference configurable through JSON: c.) localsearchOptions: have not tested. parameters seem arbitrary.
http://help.arcgis.com/en/webapi/javascript/arcgis/jsapi/#extent http://help.arcgis.com/en/webapps/flexviewer/extenthelper/flexviewer_extenthelper.html
SEARCH CLEAR RESULTS: Added a listener event in geocoder.js for the onClear() event. When user clicks on X button in search bar the icon in the map is also cleared.
SHOW ALERT MESSAGE: Logic was added to evaluate if the response.results from the geocoder. If the response is undefined, an alert message notifies the user.
Possible enhancement to Geolocator:
Zoom to all results if more than one . Add autocomplete functionality. (NOTE: will need to change toolbar layout, or set overflow: hidden on toolbar container in main.css to keep autocomplete suggestions from being hidden)
Description: