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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0048b0aca7fd9d3649e545eea299c1b6437925a9
4
- data.tar.gz: 99221069ac51f9fc5052082cec86e4f6757d46c2
3
+ metadata.gz: 1800acc3b59b03c488d1d4ce5f29d750304a3b31
4
+ data.tar.gz: 59b83ef8373521efd24e2848e6dcd391acb3c322
5
5
  SHA512:
6
- metadata.gz: 1ae80584f5fba53e80577890a305be17de6d62f8c2f12db9cd75b2ae03be533b214c752298fb4644700dd9a3df71b53abb16a03c1e3936408ab15e42ef21dff6
7
- data.tar.gz: f854c69f794f7b1af136e70f34ccc31e6f768c39ea7d08284e26cfee6d6fca9758fb44bd401982164f6160d4656aabefcd3e086ffed61146f600606ff005e403
6
+ metadata.gz: 74bea9bd9c3d5e36d7f40ec53580b4370891b02eb63ca74a24cf90cfe5c380793d0e8ebdc730c2da641855c109bb79c7356533e9c1bb4f4f2ddb47d85fc3aa25
7
+ data.tar.gz: 938a734e7e8fbfce7891196000e8618498e4ac72b2d975b044d5893bc5e85cfe1334fa49c0344553c7725f2ec31a4f9625385e59174b88f3d1e36b2d7ac67772
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.4
1
+ 0.1.5
@@ -52,33 +52,42 @@ module GoogleMaps
52
52
 
53
53
  markers = attrs.markers
54
54
 
55
- markers.then do |markers|
56
- markers.each do |marker|
57
- add_marker(marker) do |result|
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
- @add_listener.remove if @add_listener
63
- @remove_listener.remove if @remove_listener
63
+ end.watch!
64
+ end
64
65
 
65
- if markers.respond_to?(:on)
66
- @add_listener = markers.on('added') do |index|
67
- marker = markers[index]
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
- add_marker(marker) do |result|
70
- @markers[index] = result
71
- end
72
- end
73
+ @add_listener.remove if @add_listener
74
+ @remove_listener.remove if @remove_listener
73
75
 
74
- @remove_listener = markers.on('removed') do |index|
75
- marker = @markers.delete_at(index)
76
- remove_marker(marker.to_n)
77
- end
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
- end.watch!
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;`
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: volt-google_maps
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Stout