mdgio / iMap

Maryland iMAP applications
10 stars 24 forks source link

Search tool #7

Closed jsomerville closed 9 years ago

jsomerville commented 11 years ago

Description:

  1. Restrict search range to Maryland area
  2. Only show top ranked entry with pushpin
  3. Clear map pushpin when clear button is pressed in search tool
  4. Show an Alert message when no results are found
SSporik commented 11 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

SSporik commented 11 years ago

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.

SSporik commented 11 years ago

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.

SSporik commented 11 years ago

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)