Merge branch 'fix-geo-coordinates' into 'master'

Fix geocoordinates mixmatch

Closes #828

See merge request framasoft/mobilizon!1033
This commit is contained in:
Thomas Citharel 2021-08-16 08:59:29 +00:00
commit a94f2bc536
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