Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/straw-hat-labs/straw_hat_map
Map Information and Addresses Management
https://github.com/straw-hat-labs/straw_hat_map
addresses elixir elixir-lang map otp usps world-map
Last synced: 3 months ago
JSON representation
Map Information and Addresses Management
- Host: GitHub
- URL: https://github.com/straw-hat-labs/straw_hat_map
- Owner: straw-hat-labs
- License: mit
- Created: 2017-08-22T01:13:12.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-11-01T11:26:22.000Z (about 5 years ago)
- Last Synced: 2024-09-28T17:20:53.267Z (3 months ago)
- Topics: addresses, elixir, elixir-lang, map, otp, usps, world-map
- Language: Elixir
- Homepage: https://hex.pm/packages/straw_hat_map
- Size: 459 KB
- Stars: 7
- Watchers: 4
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# StrawHat.Map
[![Hex.pm](https://img.shields.io/hexpm/v/straw_hat_map.svg)](https://hex.pm/packages/straw_hat_map)
[![CI Status](https://travis-ci.org/straw-hat-team/straw_hat_map.svg?branch=master)](https://travis-ci.org/straw-hat-team/straw_hat_map)
[![Code Coverage](https://codecov.io/gh/straw-hat-team/straw_hat_map/branch/master/graph/badge.svg)](https://codecov.io/gh/straw-hat-team/straw_hat_map)Map and addresses management.
## Configuration
> **Important**
>
> `StrawHat.Map` requires an Ecto repository with `Geo.PostGIS.Extension`
> extension enabled.You need to create or extend your current PostgreSQL types:
```elixir
Postgrex.Types.define(
MyApp.PostgresTypes,
[Geo.PostGIS.Extension] ++ Ecto.Adapters.Postgres.extensions()
)
```Then make sure that you add the types to your repository connection.
```elixir
# In your config filesconfig :my_app, MyApp.Repo,
# ...
types: MyApp.PostgresTypes
```## Use cases
All the APIs are contain in the business use cases are under `Use Cases`
documentation section. Check the available modules and the public API.You should be able to comprehend the API by reading the type spec and the
function name. Please open an issue or even better make pull request about the
documation if you have any issues with it.## Migrations
Since this library does not have any repository, it does not run any migration.
You will need to handle the migrations on your application that contains the
repository.The `migrations` directory contains a series of migrations that should cover
the common use cases.> **Note**
>
> Each migration module has a `Created at` timestamp, this information is useful
> to decide when and the order on which the migrations should be run.### Using migrations
After creating an Ecto migration in your project you could call one of the
migrations from your `change` callback in your module.```elixir
defmodule MyApp.Repo.Migrations.CreateCountriesTable do
use Ecto.Migrationdef change do
StrawHat.Map.Migrations.CreateCountriesTable.change()
end
end
```