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
No related branches found
No related tags found
No related merge requests found
......@@ -32,20 +32,17 @@ module Geocoder::Lookup
end
def query_url_params(query)
params = {
:f => "pjson",
:outFields => "*"
}
if query.reverse_geocode?
{
:location => query.coordinates.reverse.join(','),
:outFields => :*,
:p => :pjson
}.merge(super)
params[:location] = query.coordinates.reverse.join(',')
else
{
:f => :pjson,
:outFields => :*,
:text => query.sanitized_text
}.merge(super)
params[:text] = query.sanitized_text
end
end
params.merge(super)
end
end
end
......@@ -289,7 +289,7 @@ class ServicesTest < Test::Unit::TestCase
query = Geocoder::Query.new([45.423733, -75.676333])
lookup = Geocoder::Lookup.get(:esri)
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
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment