Merge branch 'fix-geo-coordinates' into 'master'
Fix geocoordinates mixmatch Closes #828 See merge request framasoft/mobilizon!1033
This commit is contained in:
commit
a94f2bc536
|
@ -40,7 +40,7 @@ defmodule Mobilizon.Federation.ActivityStream.Converter.Address do
|
|||
res
|
||||
else
|
||||
geo = %Geo.Point{
|
||||
coordinates: {object["latitude"], object["longitude"]},
|
||||
coordinates: {object["longitude"], object["latitude"]},
|
||||
srid: 4326
|
||||
}
|
||||
|
||||
|
@ -72,8 +72,8 @@ defmodule Mobilizon.Federation.ActivityStream.Converter.Address do
|
|||
res
|
||||
else
|
||||
res
|
||||
|> Map.put("latitude", address.geom.coordinates |> elem(0))
|
||||
|> Map.put("longitude", address.geom.coordinates |> elem(1))
|
||||
|> Map.put("latitude", address.geom.coordinates |> elem(0))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -76,7 +76,7 @@ defmodule Mobilizon.Addresses.Address do
|
|||
def coords(nil), do: nil
|
||||
|
||||
def coords(%__MODULE__{} = address) do
|
||||
with %Geo.Point{coordinates: {latitude, longitude}, srid: 4326} <- address.geom do
|
||||
with %Geo.Point{coordinates: {longitude, latitude}, srid: 4326} <- address.geom do
|
||||
{latitude, longitude}
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue