diff options
-rw-r--r-- | gmap_arcgis.js | 14 |
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); |