1
0
Fork 0
mirror of https://framagit.org/framasoft/mobilizon.git synced 2024-12-22 16:03:25 +00:00
mobilizon/test/support/mocks/geospatial_mock.ex
Thomas Citharel c599a47d58
Introduce Mimirsbrunn geocoder and improve addresses & maps
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2019-11-12 14:10:18 +01:00

18 lines
557 B
Elixir

defmodule Mobilizon.Service.Geospatial.Mock do
@moduledoc """
Mock for Geospatial Provider implementations.
"""
alias Mobilizon.Addresses.Address
alias Mobilizon.Service.Geospatial.Provider
@behaviour Provider
@impl Provider
def geocode(_lon, _lat, _options \\ [])
def geocode(45.75, 4.85, _options), do: [%Address{description: "10 rue Jangot, Lyon"}]
def geocode(_lon, _lat, _options), do: [%Address{description: "Anywhere"}]
@impl Provider
def search(_q, _options \\ []), do: [%Address{description: "10 rue Jangot, Lyon"}]
end