aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio <silvio@socioambiental.org>2012-11-27 19:00:34 -0200
committerSilvio <silvio@socioambiental.org>2012-11-27 19:00:34 -0200
commit91eca44eec04dcb93d0110884792c510e76bbe27 (patch)
tree28fca1a351b279c5565dc94e1911efff25fe04d0
parenta17c32e22ce03138f9d0e3716e0f14187ad8b0d1 (diff)
downloadgmap_arcgis-91eca44eec04dcb93d0110884792c510e76bbe27.tar.gz
gmap_arcgis-91eca44eec04dcb93d0110884792c510e76bbe27.tar.bz2
Using setOpacity also for default polygons
-rw-r--r--gmap_arcgis.js14
1 files changed, 11 insertions, 3 deletions
diff --git a/gmap_arcgis.js b/gmap_arcgis.js
index c843cd2..3fb7c62 100644
--- a/gmap_arcgis.js
+++ b/gmap_arcgis.js
@@ -126,21 +126,25 @@ function gmapArcgisShowPolygons(polygons) {
// Hide all defined polygons
function gmapArcgisHidePolygons(polygons) {
for (j = 0; j < polygons.length; j++) {
- polygons[j].overlay.hide();
+ polygons[j].overlay.setOpacity(0);
+ unblockUI();
}
}
// Add polygons from a given ArcGIS MapServer Layer
function showPolygon(polygon) {
+ var defaultOpacity = 0.55;
+
if (typeof polygon.overlay != 'undefined') {
- polygon.overlay.show();
+ polygon.overlay.setOpacity(defaultOpacity);
+ unblockUI();
return;
}
uri = polygon['base'] + polygon['service'];
layers = polygon['layers'];
- polygon.overlay = new esri.arcgis.gmaps.DynamicMapServiceLayer(uri, null, 0.55);
+ polygon.overlay = new esri.arcgis.gmaps.DynamicMapServiceLayer(uri, null, defaultOpacity);
if (layers != undefined || layers == []) {
polygon.overlay.setVisibleLayers(layers);
@@ -171,6 +175,10 @@ function createMarker(point, name, html, icone) {
return marker;
}
+function unblockUI() {
+ $.unblockUI();
+}
+
// Add map overlays
$(document).ready(function() {
google.setOnLoadCallback(gmap_arcgis);