aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio <silvio@socioambiental.org>2013-08-05 13:44:54 -0300
committerSilvio <silvio@socioambiental.org>2013-08-05 13:44:54 -0300
commit59f9a47d4c1d1c0156db0833cf6d6cce53214578 (patch)
tree6491b31c67b8c35d7486acf2f86b2a9b422eed2c
parent37f64f4025f65e6d91c3ee76a6483fa83aca4efe (diff)
downloadgmap_arcgis_js-59f9a47d4c1d1c0156db0833cf6d6cce53214578.tar.gz
gmap_arcgis_js-59f9a47d4c1d1c0156db0833cf6d6cce53214578.tar.bz2
Fixing unblockUI
-rw-r--r--gmap_arcgis.js23
1 files changed, 9 insertions, 14 deletions
diff --git a/gmap_arcgis.js b/gmap_arcgis.js
index 315fa08..fa03c1a 100644
--- a/gmap_arcgis.js
+++ b/gmap_arcgis.js
@@ -24,7 +24,6 @@ function gmapArcgis(config) {
}
}
- // TODO: needs debug and fixing
// Return a Gmap ArcGIS object
return {
// Storable properties
@@ -42,8 +41,7 @@ function gmapArcgis(config) {
}
if (window.blockUI[name] != undefined && window.blockUI[name] == true) {
- var index = window.blockUI.indexOf(name);
- window.blockUI = window.blockUI.splice(index, 1);
+ delete window.blockUI[name];
}
if (window.blockUI.length == 0) {
@@ -140,7 +138,7 @@ function gmapArcgis(config) {
},
// Add polygons from a given ArcGIS MapServer Layer
- showPolygon: function(params) {
+ showPolygon: function(params, name) {
var self = this;
params.service = new gmaps.ags.MapService(params['uri']);
params.overlay = new gmaps.ags.MapOverlay(params.service, {
@@ -150,19 +148,17 @@ function gmapArcgis(config) {
layerDefinitions: (params['layerDefinitions'] != undefined) ? params['layerDefinitions'] : { },
},
});
-
+
if (params.callback == undefined) {
// Default callback: remove the blockUI once the layer is shown
google.maps.event.addListener(params.overlay, 'drawend', function() {
- // TODO
- self.unblockUI();
+ self.unblockUI(name);
});
}
else {
google.maps.event.addListener(params.overlay, 'drawend', function() {
params.callback(this.map, params);
- // TODO
- self.unblockUI();
+ self.unblockUI(name);
});
}
@@ -276,7 +272,7 @@ function gmapArcgis(config) {
}
this.showOverlayIf('layers', element);
- this.config['layers'][element].overlay = this.showPolygon(this.config['layers'][element]);
+ this.config['layers'][element].overlay = this.showPolygon(this.config['layers'][element], 'layers_' + element);
},
// Add a slider layer in the map
@@ -290,7 +286,7 @@ function gmapArcgis(config) {
}
this.showOverlayIf('sliders', slider);
- this.config['sliders'][slider].overlays[layer] = this.showPolygon(this.config['sliders'][slider]);
+ this.config['sliders'][slider].overlays[layer] = this.showPolygon(this.config['sliders'][slider], 'sliders_' + slider);
this.sliderUpdateOpacity(layer, slider);
},
@@ -553,7 +549,7 @@ function gmapArcgis(config) {
},
// Show a polygon resulting from the given query
- showPolygonFromQuery: function(params) {
+ showPolygonFromQuery: function(params, name) {
var self = this;
var limit = null;
var layer = new gmaps.ags.Layer(params.uri);
@@ -604,8 +600,7 @@ function gmapArcgis(config) {
self.setCenter(center, true);
}
- // TODO
- self.unblockUI();
+ self.unblockUI(name);
return params.overlay;
});
},