From 91eca44eec04dcb93d0110884792c510e76bbe27 Mon Sep 17 00:00:00 2001 From: Silvio Date: Tue, 27 Nov 2012 19:00:34 -0200 Subject: Using setOpacity also for default polygons --- gmap_arcgis.js | 14 +++++++++++--- 1 file 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); -- cgit v1.2.3