volt-google_maps 0.1.0 → 0.1.2
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 +4 -4
- data/README.md +5 -1
- data/VERSION +1 -1
- data/app/google_maps/controllers/main_controller.rb +13 -4
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3abb5ce3e9fb7cfe5570a4f9a497e76a5b36bee5
|
4
|
+
data.tar.gz: 0984286bfc63bd5226a5dd38c080bee50b704e56
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7df864ff7e46bed3a600eab6fec9b25cdc53ab85dc40535ee5dc2a906efe7990ddf4794f9f5e8aed19af250f8b1604a9b20412b9a29b0643a87acf8e4fa68440
|
7
|
+
data.tar.gz: 18ced98bc55d374fe037c95d669c6c932af9a7b2e5cee9b59656628e371233fc6d769f9f17ff6be8cf7bb7e524e9ded8930fdb7807cd6def1d7dd6ba1157f479
|
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# Google Maps Volt Component
|
2
2
|
|
3
|
+
**Note**: I haven't had time to update this gem to work with the latest Volt, so it may not work iwth the latest volt, sorry. - @ryanstout
|
4
|
+
|
3
5
|
(still a work in progress)
|
4
6
|
|
5
7
|
Provides a simple google maps integration.
|
@@ -12,6 +14,8 @@ Next put it in your config/app.rb file:
|
|
12
14
|
|
13
15
|
config.public.google_maps_api_key = '....'
|
14
16
|
|
17
|
+
Go to https://developers.google.com/maps/documentation/javascript/get-api-key to get a key.
|
18
|
+
|
15
19
|
Add this line to your application's Gemfile:
|
16
20
|
|
17
21
|
gem 'volt-google_maps'
|
@@ -42,4 +46,4 @@ The google_map tag can be passed many attributes:
|
|
42
46
|
|
43
47
|
- zoom - integer for different zoom levels
|
44
48
|
- center - the address to center the map on
|
45
|
-
- markers - an array of marker Models (with _address and _content)
|
49
|
+
- markers - an array of marker Models (with _address and _content)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
@@ -35,6 +35,14 @@ module GoogleMaps
|
|
35
35
|
|
36
36
|
def set_markers
|
37
37
|
-> do
|
38
|
+
# clear existing markers on full re-render
|
39
|
+
if @markers
|
40
|
+
@markers.each do |marker|
|
41
|
+
remove_marker(marker.to_n)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
@markers = []
|
45
|
+
|
38
46
|
markers = attrs.markers
|
39
47
|
|
40
48
|
markers.each do |marker|
|
@@ -65,7 +73,6 @@ module GoogleMaps
|
|
65
73
|
end
|
66
74
|
|
67
75
|
def setup_zoom
|
68
|
-
puts "SETUP ZOOM"
|
69
76
|
`google.maps.event.addListener(self.map, 'zoom_changed', function() {
|
70
77
|
var zoomLevel = self.map.getZoom();`
|
71
78
|
|
@@ -87,7 +94,6 @@ module GoogleMaps
|
|
87
94
|
def set_zoom
|
88
95
|
-> do
|
89
96
|
attrs.zoom
|
90
|
-
puts "SET ZOOM"
|
91
97
|
unless @changing_zoom
|
92
98
|
level = attrs.zoom
|
93
99
|
if level.blank?
|
@@ -111,6 +117,9 @@ module GoogleMaps
|
|
111
117
|
zoom: 8
|
112
118
|
};
|
113
119
|
this.map = new google.maps.Map($(node).find('.google-map-instance').get(0), mapOptions);
|
120
|
+
this.map.addListener('click', function(e) {
|
121
|
+
self.$trigger('click', e.latLng.lat(), e.latLng.lng());
|
122
|
+
});
|
114
123
|
console.log('map setup');
|
115
124
|
}
|
116
125
|
|
@@ -160,8 +169,8 @@ module GoogleMaps
|
|
160
169
|
address = marker_data
|
161
170
|
content = marker_data
|
162
171
|
else
|
163
|
-
address = marker_data._address
|
164
|
-
content = marker_data._content
|
172
|
+
address = (marker_data._address || '').to_n
|
173
|
+
content = (marker_data._content || address || '').to_n
|
165
174
|
end
|
166
175
|
|
167
176
|
geocode(address) do |latlng|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: volt-google_maps
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Stout
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: volt
|
@@ -78,7 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
78
78
|
version: '0'
|
79
79
|
requirements: []
|
80
80
|
rubyforge_project:
|
81
|
-
rubygems_version: 2.4.
|
81
|
+
rubygems_version: 2.4.5
|
82
82
|
signing_key:
|
83
83
|
specification_version: 4
|
84
84
|
summary: A google maps component for Volt
|