From f34456942c8daffdf2ffec52ca0abfbbcbc5ff79 Mon Sep 17 00:00:00 2001 From: Silvio Date: Wed, 17 Oct 2012 11:50:18 -0300 Subject: Expanding to the whole country --- gmap_arcgis.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/gmap_arcgis.js b/gmap_arcgis.js index af85eaf..31f3f07 100644 --- a/gmap_arcgis.js +++ b/gmap_arcgis.js @@ -73,8 +73,12 @@ function gmap_arcgis() { showLabels(label[0], fields, content, icon); } + // TODO: that should be defined elsewhere + //layers = [1,2,3,4,5,6,7,8]; + for (j = 0; j < polygons.length; j++) { - showPolygons(polygons[j]); + //showPolygons(polygons[j], layers); + showPolygons(polygons[j]); } }, 5); @@ -122,14 +126,21 @@ function showLabelsCallback(fields, content, icon) { } // Add polygons from a given ArcGIS MapServer Layer -function showPolygons(uri) { +function showPolygons(uri, layers = undefined) { pol = new esri.arcgis.gmaps.DynamicMapServiceLayer(uri, null, 0.55); - GEvent.addListener(pol,"load",function(g){ map.addOverlay(g);setTimeout($.unblockUI, 6000);}); + + if (layers != undefined) { + pol.setVisibleLayers(layers); + } + + //GEvent.addListener(pol,"load",function(g){ map.addOverlay(g);setTimeout($.unblockUI, 6000);}); + GEvent.addListener(pol,"load", showPolygonsCallback); } // Callback for showPolygons function showPolygonsCallback(mapservicelayer, error) { map.addOverlay(mapservicelayer); + setTimeout($.unblockUI, 6000); } // Add custom marker -- cgit v1.2.3