gmap_coordinates_picker 0.0.12 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b4cfba6571184c20dd751aed25d6c9a385e74650
|
4
|
+
data.tar.gz: 4933899cc88b1558a52113f43f06c3c3f46f0be0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 914e5d5acc3ef9747638b7ca95331212f1716a0ea40ee24c84c7cab27acd812a12ce5763fc6a28b6ea405fd0475f74d43e5f5950f33f17af345968fec4bfa9f5
|
7
|
+
data.tar.gz: 6b2e9dc1b26996952d484d16b7de45f3dfc72ec011af9428f242082e3ea508973dc36d749650b989aa54eeda05ad21c7cb683d763ff5ab5a6e11ae23092646fd
|
data/README.md
CHANGED
@@ -22,18 +22,18 @@ gem " gmap_coordinates_picker"
|
|
22
22
|
Then, add in your form:
|
23
23
|
|
24
24
|
```ruby
|
25
|
-
<%= form.gmap_coordinate_picker :lat_column => 'latitude', :lng_column => 'longitude' , :zoom_level => 10, :default_coordinates => [lat,lng], autocomplete: { enable: true, class: 'form-control' } %>
|
25
|
+
<%= 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' } %>
|
26
26
|
```
|
27
27
|
|
28
28
|
Or, user is as form helper:
|
29
29
|
|
30
30
|
```ruby
|
31
|
-
<%= render_gmap_coordinate_picker :lat_column => 'latitude', :lng_column => 'longitude' , :zoom_level => 10, :default_coordinates => [lat,lng], autocomplete: { enable: true, class: 'form-control' } %>
|
31
|
+
<%= 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' } %>
|
32
32
|
```
|
33
33
|
To display static map:
|
34
34
|
|
35
35
|
```ruby
|
36
|
-
<%= render_gmap_coordinate_picker :static => 'true', :zoom_level => 10 , :default_coordinates => [lat,lng] %>
|
36
|
+
<%= render_gmap_coordinate_picker api_key: GOOGLE_MAP_API_KEY, :static => 'true', :zoom_level => 10 , :default_coordinates => [lat,lng] %>
|
37
37
|
```
|
38
38
|
|
39
39
|
|
@@ -45,7 +45,7 @@ beside the option depicted on the example above it can be configured with the fo
|
|
45
45
|
- `map_container_class` - custom class for the map container
|
46
46
|
- `map_width` - default "600px
|
47
47
|
- `map_height` - default "400px"
|
48
|
-
- `api_key` - Google Map api key
|
48
|
+
- `api_key` - Google Map api key
|
49
49
|
- 'static' - to display only static map, by default it set to false and the map will be editable
|
50
50
|
- 'map_handler' - javascript map object to operate custom event on rendered map by default gMapObj is assigned as map object. You can implement any google map API methods like setCenter, zoom with that object
|
51
51
|
- 'autocomplete' - enable autocomplete with input class - default "{ enable: true, class: 'form-control' }"
|
@@ -31,7 +31,7 @@ module GmapCoordinatesPicker
|
|
31
31
|
config.default_coordinates = [23.727666666, 90.410550] #Dhaka (my home town) center point :)
|
32
32
|
config.map_handler = 'gMapObj'
|
33
33
|
config.zoom_level = 10
|
34
|
-
config.autocomplete = { enable:
|
34
|
+
config.autocomplete = { enable: false, class: 'form-control'}
|
35
35
|
config.map_container_class = 'gmap_coordinate_picker_container'
|
36
36
|
config.map_width = '600px'
|
37
37
|
config.map_height = '400px'
|
@@ -27,7 +27,7 @@ module GmapCoordinatesPicker #:nodoc
|
|
27
27
|
:map_width => options[:map_width] || GmapCoordinatesPicker.config.map_width,
|
28
28
|
:map_height => options[:map_height] || GmapCoordinatesPicker.config.map_height,
|
29
29
|
:autocomplete => options[:autocomplete] || GmapCoordinatesPicker.config.autocomplete,
|
30
|
-
:default_coordinates =>
|
30
|
+
:default_coordinates => default_coordinates.empty? ? GmapCoordinatesPicker.config.default_coordinates : options[:default_coordinates],
|
31
31
|
}
|
32
32
|
|
33
33
|
editable_map_locals = {
|