diff options
author | Silvio <silvio@socioambiental.org> | 2012-10-17 11:50:18 -0300 |
---|---|---|
committer | Silvio <silvio@socioambiental.org> | 2012-10-17 11:50:18 -0300 |
commit | f34456942c8daffdf2ffec52ca0abfbbcbc5ff79 (patch) | |
tree | a40a530374cb141f410302408e50376bd919fb07 | |
parent | cfb26c5af37da595a7a81f90065fde9537dbc6b1 (diff) | |
download | gmap_arcgis-f34456942c8daffdf2ffec52ca0abfbbcbc5ff79.tar.gz gmap_arcgis-f34456942c8daffdf2ffec52ca0abfbbcbc5ff79.tar.bz2 |
Expanding to the whole country
-rw-r--r-- | gmap_arcgis.js | 17 |
1 files 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 |