https://github.com/forsaken1/activeadmin-latlng
Active Admin plugin for setting up latitude and longitude
https://github.com/forsaken1/activeadmin-latlng
activeadmin admin-dashboard google-maps latitude-and-longitude maps plugin yandex-maps
Last synced: 26 days ago
JSON representation
Active Admin plugin for setting up latitude and longitude
- Host: GitHub
- URL: https://github.com/forsaken1/activeadmin-latlng
- Owner: forsaken1
- License: mit
- Created: 2016-03-05T07:47:22.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2020-06-05T14:52:40.000Z (almost 5 years ago)
- Last Synced: 2025-03-24T07:16:45.050Z (about 1 month ago)
- Topics: activeadmin, admin-dashboard, google-maps, latitude-and-longitude, maps, plugin, yandex-maps
- Language: Ruby
- Homepage: https://rubygems.org/gems/activeadmin_latlng
- Size: 831 KB
- Stars: 37
- Watchers: 2
- Forks: 17
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- License: MIT-LICENSE
Awesome Lists containing this project
README
# ActiveadminLatlng
[](https://travis-ci.org/forsaken1/activeadmin-latlng)
[](https://codeclimate.com/github/forsaken1/activeadmin-latlng)
[](https://codecov.io/gh/forsaken1/activeadmin-latlng)Active Admin latitude and longitude plugin

## Getting started
```ruby
gem 'activeadmin_latlng'
``````ruby
form do |f|
f.inputs do
f.input :lat
f.input :lng
f.latlng # add this
end
f.actions
end
```## Settings
* `lang` - language, `en` by default.
* `map` - map provider, `google` by default. Available: `google`, `yandex`, `openstreetmap`.
* `id_lat` and `id_lng` - identificator of latitude and longitude inputs. `_lat` and `_lng` by default.
* `height` - map height in pixels, `400` by default.
* `loading_map` - loading map library. `true` by default. Set to `false`, if map loaded in other place.
* `api_key` - you can send api key to map. WARNING! This is unsafe method, better use ENV-variable.
* `api_key_env` - you can send name of ENV-variable where storing API key for map.
* `default_lat` - default latitude for placemark, Moscow latitude by default.
* `default_lng` - default longitude for placemark, Moscow longitude by default.
* `map_zoom` - default zoom for map, `12` by default.
### Example
```ruby
form do |f|
f.inputs do
f.input :lat
f.input :lng
f.latlng lang: :ru, map: :yandex, height: 500, loading_map: false, api_key_env: 'GOOGLE_API_KEY'
end
f.actions
end
```## Contributors
Alexey Krylov
## License
MIT License. Copyright 2018 Alexey Krylov