aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gmap_arcgis.js17
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