spatial_features 2.1.2 → 2.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/spatial_features/has_fusion_table_features.rb +16 -8
- data/lib/spatial_features/version.rb +1 -1
- 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: 161e05dd5050ab333151fad1b7ec795e3f7586dd
|
4
|
+
data.tar.gz: 64e96f4e2f77c54db017c31e0d7babcce42015ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 42339e9b2190d5ad0b88a5823140b70febf158de17978822598799d22ad46e0276f76d28c1289599acfd24e7fd36d2c946e0bb2e09f1e43e37c48f6feb2c4c7f
|
7
|
+
data.tar.gz: 52bb8cfed4a5728f997e8f0cbb7b6ededf330e1f7dbf1ce6478b7306556f802165a3746e6ba8a1e9f626c541e93138636984b23af998658aa021c34b2e792b04
|
@@ -7,8 +7,6 @@ module SpatialFeatures
|
|
7
7
|
|
8
8
|
include InstanceMethods
|
9
9
|
extend ClassMethods
|
10
|
-
|
11
|
-
delegate :update_fusion_table, :delete_fusion_table, :fusion_table_id_cache, :to => self
|
12
10
|
end
|
13
11
|
end
|
14
12
|
|
@@ -17,14 +15,14 @@ module SpatialFeatures
|
|
17
15
|
sanitize_sql(["spatial_model_id IN (?)", pluck(:id)])
|
18
16
|
end
|
19
17
|
|
20
|
-
def update_fusion_tables
|
21
|
-
fusion_table_groups do |fusion_table_id, records, group_features|
|
18
|
+
def update_fusion_tables(group_options = {})
|
19
|
+
fusion_table_groups(group_options) do |fusion_table_id, records, group_features|
|
22
20
|
API.set_features(fusion_table_id, group_features, :colour => fusion_table_features_options[:colour])
|
23
21
|
end
|
24
22
|
end
|
25
23
|
|
26
|
-
def delete_fusion_tables
|
27
|
-
fusion_table_groups do |fusion_table_id, records, group_features|
|
24
|
+
def delete_fusion_tables(group_options = {})
|
25
|
+
fusion_table_groups(group_options) do |fusion_table_id, records, group_features|
|
28
26
|
API.delete_table(fusion_table_id)
|
29
27
|
end
|
30
28
|
fusion_table_id_cache.clear
|
@@ -42,8 +40,10 @@ module SpatialFeatures
|
|
42
40
|
|
43
41
|
private
|
44
42
|
|
45
|
-
def fusion_table_groups
|
43
|
+
def fusion_table_groups(only: [], except: [])
|
46
44
|
all.group_by(&:fusion_table_id).each do |fusion_table_id, records|
|
45
|
+
next if only.present? && !Array.wrap(only).include?(fusion_table_id)
|
46
|
+
next if except.present? && Array.wrap(except).include?(fusion_table_id)
|
47
47
|
yield fusion_table_id, records, features.where(:spatial_model_id => records)
|
48
48
|
end
|
49
49
|
end
|
@@ -54,8 +54,16 @@ module SpatialFeatures
|
|
54
54
|
true
|
55
55
|
end
|
56
56
|
|
57
|
+
def update_fusion_table
|
58
|
+
self.class.update_fusion_tables(only: fusion_table_id)
|
59
|
+
end
|
60
|
+
|
61
|
+
def delete_fusion_table
|
62
|
+
self.class.delete_fusion_tables(only: fusion_table_id)
|
63
|
+
end
|
64
|
+
|
57
65
|
def fusion_table_id
|
58
|
-
fusion_table_id_cache[fusion_table_name]
|
66
|
+
self.class.fusion_table_id_cache[fusion_table_name]
|
59
67
|
end
|
60
68
|
|
61
69
|
def fusion_table_name
|