Skip to content

Commit

Permalink
Merge pull request #229 from yosiat/parse-float-yandex
Browse files Browse the repository at this point in the history
Yandex: return float lat/lng instead of string
  • Loading branch information
nchaulet authored Sep 28, 2017
2 parents 5cb08ed + 820dca3 commit 34e2224
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/geocoder/yandexgeocoder.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ function _formatResult(result) {
result = result.GeoObject.metaDataProperty.GeocoderMetaData.AddressDetails;

return {
'latitude' : position[1],
'longitude' : position[0],
'latitude' : parseFloat(position[1]),
'longitude' : parseFloat(position[0]),
'city' : _findKey(result, 'LocalityName'),
'state' : _findKey(result, 'AdministrativeAreaName'),
'streetName': _findKey(result, 'ThoroughfareName'),
Expand Down
8 changes: 4 additions & 4 deletions test/geocoder/yandexgeocoder.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ describe('YandexGeocoder', function() {
err.should.to.equal(false);

results[0].should.to.deep.equal({
'latitude': '40.653388',
'longitude': '-73.944050',
'latitude': 40.653388,
'longitude': -73.944050,
'country': 'United States',
'city': 'New York',
'state' : 'New York',
Expand Down Expand Up @@ -197,8 +197,8 @@ describe('YandexGeocoder', function() {
'city': 'Собинка',
'country': 'Россия',
'countryCode': 'RU',
'latitude': '55.98507',
'longitude': '40.018571',
'latitude': 55.98507,
'longitude': 40.018571,
'state': 'Владимирская область',
'streetName': 'Центральная улица',
'streetNumber': '15',
Expand Down

0 comments on commit 34e2224

Please sign in to comment.