Skip to content
Snippets Groups Projects
Commit 72c622bf authored by Alex Reisner's avatar Alex Reisner
Browse files

Fix incorrect parameter name (ESRI).

parent 5ec9a28c
Branches
Tags
No related merge requests found
...@@ -32,19 +32,16 @@ module Geocoder::Lookup ...@@ -32,19 +32,16 @@ module Geocoder::Lookup
end end
def query_url_params(query) def query_url_params(query)
params = {
:f => "pjson",
:outFields => "*"
}
if query.reverse_geocode? if query.reverse_geocode?
{ params[:location] = query.coordinates.reverse.join(',')
:location => query.coordinates.reverse.join(','),
:outFields => :*,
:p => :pjson
}.merge(super)
else else
{ params[:text] = query.sanitized_text
:f => :pjson,
:outFields => :*,
:text => query.sanitized_text
}.merge(super)
end end
params.merge(super)
end end
end end
......
...@@ -289,7 +289,7 @@ class ServicesTest < Test::Unit::TestCase ...@@ -289,7 +289,7 @@ class ServicesTest < Test::Unit::TestCase
query = Geocoder::Query.new([45.423733, -75.676333]) query = Geocoder::Query.new([45.423733, -75.676333])
lookup = Geocoder::Lookup.get(:esri) lookup = Geocoder::Lookup.get(:esri)
res = lookup.query_url(query) res = lookup.query_url(query)
assert_equal "http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/reverseGeocode?location=-75.676333%2C45.423733&outFields=%2A&p=pjson", assert_equal "http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/reverseGeocode?f=pjson&location=-75.676333%2C45.423733&outFields=%2A",
res res
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment