AnsweredAssumed Answered

Geocoding with local geocoder: map does not zoom to results

Question asked by eendrulat on Mar 7, 2013
Latest reply on Mar 14, 2013 by eendrulat
I???m attempting to reconfigure a geocoding application based on the Javascript API sample here:

The only changes that I've made to the original code are 1) referencing my own webmap, and 2) reference a local geocoder service. The application can be viewed here:

The application works as expected except instead of zooming to the location searched for or selected from the dropdown list,  it places the point and recenters the map (extent stays the same). I need to determine how to zoom to the results returned by my own geocoding service.

The code doesn't have any functions that explicitly take the geometry from the geocoding results and reset the map extent based on these, so i'm assuming this is something built into the geocoding digit.  I explored the JSON returned from Esri's geocoding service and compared it to what was returned from my own ArcGIS Server, and see there are many differences in the elements returned (e.g., own instance of ArcGIS Server returns 'location' containing x/y coordinates; whereas Esri's geocoding service includes the x/y coordinates in the 'geometry', and also returns the extent (strange, for a point feature..)

JSON from ArcGIS Server:  spatialReference wkid : 102100 [number] candidates 0 address : 97301 [string] location x : -13692817.9706 [number] y : 5613666.2399 [number] score : 100 [number] attributes   JSON from Esri's Geocode service:  spatialReference wkid : 102100 [number] latestWkid : 3857 [number] locations 0 name : 97330, Corvallis, OR [string] extent xmin : -13728247.885804845 [number] ymin : 5549357.770796694 [number] xmax : -13717115.936725518 [number] ymax : 5564989.215078552 [number] feature geometry x : -13722681.804322762 [number] y : 5557170.2004600745 [number] attributes Score : 100 [number] Addr_Type : Postal [string] 1

Does anyone have any thoughts on how to best make this work, i.e., enable zoom-to-address using on-premise ArcGIS Server Geocoding service?

Thank you,
Erik Endrulat