Skip to content

Commit f9da3fd

Browse files
committedJan 9, 2015
Merge pull request nchaulet#70 from spencerapplegate/master
Referencing Street Address Number correctly for ArcGIS provider
2 parents 118ae00 + 7b5b183 commit f9da3fd

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed
 

‎lib/geocoder/agolgeocoder.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ AGOLGeocoder.prototype.geocode = function(value, callback) {
108108
'token':token,
109109
'f':"json",
110110
'text':value,
111-
'outFields': 'AddrNum,StPreDir,StName,StType,City,Postal,Region,Country'
111+
'outFields': 'AddNum,StPreDir,StName,StType,City,Postal,Region,Country'
112112
};
113113

114114
_this.httpAdapter.get(_this._endpoint, params, function(err, result) {
@@ -179,7 +179,7 @@ AGOLGeocoder.prototype._formatResult = function(result) {
179179
state = attributes[property];
180180
if(property == "StPreDir")
181181
streetPreDir = attributes[property];
182-
if(property == "AddrNum")
182+
if(property == "AddNum")
183183
streetNumber = attributes[property];
184184
if(property == "StName")
185185
streetName = attributes[property];

‎test/geocoder/agolgeocoder.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ describe('AGOLGeocoder', function() {
137137
var mock = sinon.mock(mockedRequestifyAdapter);
138138

139139
mock.expects('get').once().callsArgWith(2, false,
140-
'{"spatialReference":{"wkid":4326,"latestWkid":4326},"locations":[{"name":"380 New York St, Redlands, California, 92373","extent":{"xmin":-117.196701,"ymin":34.055489999999999,"xmax":-117.19470099999999,"ymax":34.057490000000001},"feature":{"geometry":{"x":-117.19566584280369,"y":34.056490727765947},"attributes":{"AddrNum":"","StPreDir":"","StName":"New York","StType":"St","City":"Redlands","Postal":"92373","Region":"California","Country":"USA"}}}]}'
140+
'{"spatialReference":{"wkid":4326,"latestWkid":4326},"locations":[{"name":"380 New York St, Redlands, California, 92373","extent":{"xmin":-117.196701,"ymin":34.055489999999999,"xmax":-117.19470099999999,"ymax":34.057490000000001},"feature":{"geometry":{"x":-117.19566584280369,"y":34.056490727765947},"attributes":{"AddNum":"380","StPreDir":"","StName":"New York","StType":"St","City":"Redlands","Postal":"92373","Region":"California","Country":"USA"}}}]}'
141141
);
142142
var geocoder = new AGOLGeocoder(mockedRequestifyAdapter,mockedOptions);
143143

@@ -156,7 +156,7 @@ describe('AGOLGeocoder', function() {
156156
stateCode: null,
157157
zipcode: '92373',
158158
streetName: ' New York St',
159-
streetNumber: '',
159+
streetNumber: '380',
160160
countryCode: 'USA'
161161
});
162162
mock.verify();

0 commit comments

Comments
 (0)
Please sign in to comment.