
Security News
New Website “Is It Really FOSS?” Tracks Transparency in Open Source Distribution Models
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
gmap_coordinates_picker
Advanced tools
works to provide an easy to use Google Maps interface for displaying and setting geographic co-ordinates .
Where a latitude and longitude is set on the model, it is indicated by a marker shown on a Google map centered at the marker. The administrator can change the value of these fields by clicking on the desired new location on the map.
https://github.com/amuntasim/gmap-coordicate-picker-demo
add the following to your Gemfile
:
gem " gmap_coordinates_picker"
Then, add in your form:
<%= form.gmap_coordinate_picker api_key: GOOGLE_MAP_API_KEY, :lat_column => 'latitude', :lng_column => 'longitude' , :zoom_level => 10, :default_coordinates => [lat,lng], autocomplete: { enable: true, class: 'form-control' } %>
Or, user is as form helper:
<%= render_gmap_coordinate_picker api_key: GOOGLE_MAP_API_KEY, :lat_column => 'latitude', :lng_column => 'longitude' , :zoom_level => 10, :default_coordinates => [lat,lng], autocomplete: { enable: true, class: 'form-control' } %>
To display static map:
<%= render_gmap_coordinate_picker api_key: GOOGLE_MAP_API_KEY, :static => 'true', :zoom_level => 10 , :default_coordinates => [lat,lng] %>
beside the option depicted on the example above it can be configured with the following:
map_container_class
- custom class for the map containermap_width
- default "600pxmap_height
- default "400px"api_key
- Google Map api keyYou can configure the following default values by overriding these values using: GmapCoordinatesPicker.configure method.
lat_column #= :latitude lng_column #= :longitude default_coordinates #= [23.727666666, 90.410550] #Dhaka (my home town) center point :) map_handler #= 'gMapObj' zoom_level #= 10 map_container_class #= 'gmap_coordinate_picker_container' map_width #= '600px' map_height #= '400px' autocomplete #= { enable: true, class: 'form-control' }
There's a handy generator that generates the default configuration file into config/initializers directory. Run the following generator command, then edit the generated file.
rails g gmap_coordinates_picker:config
-0.1.0 - Rails4 support
-0.0.3
- static map
feature added
- javascript map handler
support added
-0.0.2 render_gmap_coordinate_picker for for helper
is licensed under the MIT license.
Copyright (C) 2013 by Muntasim Ahmed
Inspired from rails_admin_map_field (https://github.com/trademobile/rails_admin_map_field)
FAQs
Unknown package
We found that gmap_coordinates_picker demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.