aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio <silvio@socioambiental.org>2013-07-31 16:45:35 -0300
committerSilvio <silvio@socioambiental.org>2013-07-31 16:45:35 -0300
commit08c9b141ae506468cd781845f8edea2cb5a1dec5 (patch)
tree10a5130186ea17bd35c76751287d836e6eb747be
parent2336bc3662b9a277e4f0e3d6cc5c1e4955d308d9 (diff)
downloadgmap_arcgis_js-08c9b141ae506468cd781845f8edea2cb5a1dec5.tar.gz
gmap_arcgis_js-08c9b141ae506468cd781845f8edea2cb5a1dec5.tar.bz2
Fixing listeners on showPolygon()
-rw-r--r--gmap_arcgis.js19
1 files changed, 10 insertions, 9 deletions
diff --git a/gmap_arcgis.js b/gmap_arcgis.js
index bc67623..19e06a5 100644
--- a/gmap_arcgis.js
+++ b/gmap_arcgis.js
@@ -115,6 +115,7 @@ function gmapArcgis(config) {
// Add polygons from a given ArcGIS MapServer Layer
showPolygon: function(params) {
+ var self = this;
params.service = new gmaps.ags.MapService(params['uri']);
params.overlay = new gmaps.ags.MapOverlay(params.service, {
exportOptions: {
@@ -124,24 +125,24 @@ function gmapArcgis(config) {
},
});
- params.overlay.setMap(this.map);
- params.overlay.setOpacity(params.opacity);
-
- this.identifyPolygon(params);
-
if (params.callback == undefined) {
// Default callback: remove the blockUI once the layer is shown
- google.maps.event.addListener(params.overlay.getMapService(), 'update', function() {
- this.unblockUI();
+ google.maps.event.addListener(params.overlay, 'drawend', function() {
+ self.unblockUI();
});
}
else {
- google.maps.event.addListener(params.overlay.getMapService(), 'update', function() {
+ google.maps.event.addListener(params.overlay, 'drawend', function() {
params.callback(this.map, params);
- this.unblockUI();
+ self.unblockUI();
});
}
+ params.overlay.setMap(this.map);
+ params.overlay.setOpacity(params.opacity);
+
+ this.identifyPolygon(params);
+
return params.overlay;
},