1
0
Fork 0
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:
Thomas Citharel 2021-08-16 10:23:16 +02:00
parent 22b2a4aff8
commit 34e2c4f310
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773
2 changed files with 3 additions and 3 deletions

View file

@ -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

View file

@ -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