kmz_compressor 2.0.7 → 2.0.8
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 65db92edb568571f0dcd7be6b65898e8d0a8aed1
|
4
|
+
data.tar.gz: 3d0189bcfab3627170a72e2f32076889f8589a91
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 069c187f9884e2f3fde0e1aaae283296a28541ac38040e07aa8b37dd0f6433f051ad8c004229b27161ed93535412b9cba210557c8fd0b42952c532c260616933
|
7
|
+
data.tar.gz: 57d1276e71dd73a9ed36f83fff793ef6eb9ef15a1c4820fade890ac6e06489607c10293bcb70be7a5fa15ce36a5c07c9e19eed5668baa3a234805b981a7eaf86
|
@@ -5,6 +5,8 @@ window.MapLayerManager = function(map){
|
|
5
5
|
var requestTimestamps = {}
|
6
6
|
var layerLoadingEventName = 'map:layerLoading'
|
7
7
|
var layerLoadedEventName = 'map:layerLoaded'
|
8
|
+
var layerRemovedEventName = 'map:layerRemoved'
|
9
|
+
var layerHiddenEventName = 'map:layerHidden'
|
8
10
|
|
9
11
|
// Prime the KMZ cache on the server before unleashing google's many tilemills
|
10
12
|
function cacheAndLoadKMLLayer(kmlURL, layerName, options) {
|
@@ -28,7 +30,7 @@ window.MapLayerManager = function(map){
|
|
28
30
|
var kmlLayer = new google.maps.KmlLayer(kmlURL, options);
|
29
31
|
var layer = addLayer(layerName, kmlLayer)
|
30
32
|
loadingCount++
|
31
|
-
$(
|
33
|
+
$(map.getDiv()).trigger({type: layerLoadingEventName, layer:layer})
|
32
34
|
|
33
35
|
// Try and catch the defaultviewport_changed event so we can remove the old layer (sometimes this works, sometimes not)
|
34
36
|
google.maps.event.addListener(kmlLayer, 'defaultviewport_changed', function(){
|
@@ -60,12 +62,12 @@ window.MapLayerManager = function(map){
|
|
60
62
|
}
|
61
63
|
|
62
64
|
if (layersLoaded(layerNamez)){
|
63
|
-
$(
|
65
|
+
$(map.getDiv()).unbind(layerLoadedEventName, handler)
|
64
66
|
centerOnLayers(layerNamez);
|
65
67
|
}
|
66
68
|
}
|
67
69
|
|
68
|
-
$(
|
70
|
+
$(map.getDiv()).bind(layerLoadedEventName, handler)
|
69
71
|
}
|
70
72
|
|
71
73
|
// Returns the layer names
|
@@ -94,6 +96,11 @@ window.MapLayerManager = function(map){
|
|
94
96
|
// Hides the layer and returns true, returns false if the layer couldn't be hidden, returns nothing if the layer existed but the kml hadn't yet been loaded
|
95
97
|
function hideLayer(layerName){
|
96
98
|
var layer = getLayer(layerName);
|
99
|
+
|
100
|
+
if (layer){
|
101
|
+
$(map.getDiv()).trigger({type: layerHiddenEventName, layer:layer})
|
102
|
+
}
|
103
|
+
|
97
104
|
if (layer && layer.kml){
|
98
105
|
layer.oldMap = layer.kml.getMap();
|
99
106
|
layer.kml.setMap(null)
|
@@ -153,6 +160,7 @@ window.MapLayerManager = function(map){
|
|
153
160
|
if (layer.name == layerName){
|
154
161
|
layer.kml.setMap(null)
|
155
162
|
layers.splice(index, 1);
|
163
|
+
$(map.getDiv()).trigger({type: layerRemovedEventName, layer:layer})
|
156
164
|
return;
|
157
165
|
}
|
158
166
|
});
|
@@ -182,7 +190,7 @@ window.MapLayerManager = function(map){
|
|
182
190
|
loadingCount--
|
183
191
|
layer.loaded = true
|
184
192
|
layer.error = kmlStatus == 'OK' ? null : kmlStatus // if there were any errors, record them
|
185
|
-
$(
|
193
|
+
$(map.getDiv()).trigger({type: layerLoadedEventName, layer:layer})
|
186
194
|
}
|
187
195
|
|
188
196
|
// A layer should be hidden, but the kml is showing, hide it (i.e. correct layers that were hidden before the kml was loaded)
|
@@ -237,5 +245,5 @@ window.MapLayerManager = function(map){
|
|
237
245
|
|
238
246
|
// PUBLIC INTERFACE
|
239
247
|
|
240
|
-
return {cacheAndLoadKMLLayer:cacheAndLoadKMLLayer, loadKMLLayer:loadKMLLayer, centerWhenLoaded:centerWhenLoaded, addLayer:addLayer, removeLayer:removeLayer, map:map, loadingCount:loadingCount}
|
248
|
+
return {cacheAndLoadKMLLayer:cacheAndLoadKMLLayer, loadKMLLayer:loadKMLLayer, centerWhenLoaded:centerWhenLoaded, addLayer:addLayer, removeLayer:removeLayer, layerNames:layerNames, map:map, loadingCount:loadingCount}
|
241
249
|
}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kmz_compressor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Wallace
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-06-
|
12
|
+
date: 2014-06-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|