2019-03-14 17:31:14 +00:00
|
|
|
defmodule Mobilizon.Service.Geospatial.Mock do
|
2019-03-12 10:52:28 +00:00
|
|
|
@moduledoc """
|
2019-09-22 14:26:23 +00:00
|
|
|
Mock for Geospatial Provider implementations.
|
2019-03-12 10:52:28 +00:00
|
|
|
"""
|
2019-09-22 14:26:23 +00:00
|
|
|
|
2019-03-12 10:52:28 +00:00
|
|
|
alias Mobilizon.Addresses.Address
|
2019-09-22 14:26:23 +00:00
|
|
|
alias Mobilizon.Service.Geospatial.Provider
|
2019-03-12 10:52:28 +00:00
|
|
|
|
|
|
|
@behaviour Provider
|
|
|
|
|
|
|
|
@impl Provider
|
2019-11-08 18:37:14 +00:00
|
|
|
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"}]
|
2019-03-12 10:52:28 +00:00
|
|
|
|
|
|
|
@impl Provider
|
2019-03-14 17:31:14 +00:00
|
|
|
def search(_q, _options \\ []), do: [%Address{description: "10 rue Jangot, Lyon"}]
|
2019-03-12 10:52:28 +00:00
|
|
|
end
|