mirror of
https://framagit.org/framasoft/mobilizon.git
synced 2024-12-22 07:52:43 +00:00
Fix geocoordinates mixmatch
Closes #828 Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
22b2a4aff8
commit
34e2c4f310
2 changed files with 3 additions and 3 deletions
|
@ -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