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

Reverse coordinate order for Yandex.

On input and output (expects/returns lon,lat instead of lat,lon).
parent 1bd5a78a
No related branches found
No related tags found
No related merge requests found
......@@ -18,6 +18,7 @@ module Geocoder::Lookup
end
def query_url(query, reverse = false)
query = query.split(",").reverse.join(",") if reverse
params = {
:geocode => query,
:format => "json",
......
......@@ -4,7 +4,7 @@ module Geocoder::Result
class Yandex < Base
def coordinates
@data['GeoObject']['Point']['pos'].split(' ').map(&:to_f)
@data['GeoObject']['Point']['pos'].split(' ').reverse.map(&:to_f)
end
def address(format = :full)
......
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