Skip to content

Commit

Permalink
fix(geocoder): fix handling of ArcGis search results
Browse files Browse the repository at this point in the history
fix #181
  • Loading branch information
landonreed committed Jun 26, 2020
1 parent e04aac7 commit 072139b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/util/geocoder.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,11 @@ class ArcGISGeocoder extends Geocoder {
* format.
*/
getLocationFromGeocodedFeature (feature) {
// If feature was returned from 'search' query, it will already be
// structured properly.
if (feature.geometry) return Geocoder.prototype.getLocationFromGeocodedFeature(feature)
// If feature returned from autocomplete, we need to use the magicKey to get
// the location's coordinates.
return this.api.search({ magicKey: feature.magicKey, text: feature.text })
.then(response => {
const feature = response.features[0]
Expand Down

0 comments on commit 072139b

Please sign in to comment.