volt-google_maps 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/app/google_maps/controllers/main_controller.rb +31 -19
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1800acc3b59b03c488d1d4ce5f29d750304a3b31
|
4
|
+
data.tar.gz: 59b83ef8373521efd24e2848e6dcd391acb3c322
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74bea9bd9c3d5e36d7f40ec53580b4370891b02eb63ca74a24cf90cfe5c380793d0e8ebdc730c2da641855c109bb79c7356533e9c1bb4f4f2ddb47d85fc3aa25
|
7
|
+
data.tar.gz: 938a734e7e8fbfce7891196000e8618498e4ac72b2d975b044d5893bc5e85cfe1334fa49c0344553c7725f2ec31a4f9625385e59174b88f3d1e36b2d7ac67772
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.5
|
@@ -52,33 +52,42 @@ module GoogleMaps
|
|
52
52
|
|
53
53
|
markers = attrs.markers
|
54
54
|
|
55
|
-
markers.
|
56
|
-
markers.
|
57
|
-
|
58
|
-
@markers << result
|
59
|
-
end
|
55
|
+
if markers.is_a?(Promise)
|
56
|
+
markers.then do |markers|
|
57
|
+
track_markers(markers)
|
60
58
|
end
|
59
|
+
else
|
60
|
+
track_markers(markers)
|
61
|
+
end
|
61
62
|
|
62
|
-
|
63
|
-
|
63
|
+
end.watch!
|
64
|
+
end
|
64
65
|
|
65
|
-
|
66
|
-
|
67
|
-
|
66
|
+
def track_markers(markers)
|
67
|
+
markers.each do |marker|
|
68
|
+
add_marker(marker) do |result|
|
69
|
+
@markers << result
|
70
|
+
end
|
71
|
+
end
|
68
72
|
|
69
|
-
|
70
|
-
|
71
|
-
end
|
72
|
-
end
|
73
|
+
@add_listener.remove if @add_listener
|
74
|
+
@remove_listener.remove if @remove_listener
|
73
75
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
76
|
+
if markers.respond_to?(:on)
|
77
|
+
@add_listener = markers.on('added') do |index|
|
78
|
+
marker = markers[index]
|
79
|
+
|
80
|
+
add_marker(marker) do |result|
|
81
|
+
@markers[index] = result
|
78
82
|
end
|
79
83
|
end
|
80
84
|
|
81
|
-
|
85
|
+
@remove_listener = markers.on('removed') do |index|
|
86
|
+
marker = @markers.delete_at(index)
|
87
|
+
remove_marker(marker.to_n)
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
82
91
|
end
|
83
92
|
|
84
93
|
def setup_zoom
|
@@ -163,6 +172,9 @@ module GoogleMaps
|
|
163
172
|
return
|
164
173
|
end
|
165
174
|
|
175
|
+
# needed for some reason, sometimes strings come in weird
|
176
|
+
`address = address + "";`
|
177
|
+
|
166
178
|
`this.geocoder.geocode( { 'address': address}, function(results, status) {`
|
167
179
|
`if (status == google.maps.GeocoderStatus.OK) {`
|
168
180
|
`var latlng = results[0].geometry.location;`
|