aboutsummaryrefslogtreecommitdiff
path: root/gmap_arcgis.js
diff options
context:
space:
mode:
authorSilvio <silvio@socioambiental.org>2013-02-27 18:41:15 -0300
committerSilvio <silvio@socioambiental.org>2013-02-27 18:41:15 -0300
commitd1cb222f75e5bfec318b4cc7964fd6aa600bf89a (patch)
treebe80be42fc65971ec1dbdfec6d13d5d9ac06256c /gmap_arcgis.js
parent375a098c6d1deac4f2c7b1ee591e6aec1ed5d12b (diff)
downloadgmap_arcgis-d1cb222f75e5bfec318b4cc7964fd6aa600bf89a.tar.gz
gmap_arcgis-d1cb222f75e5bfec318b4cc7964fd6aa600bf89a.tar.bz2
Adding map parameter to show/hide polygons; removing blockUI() call
Diffstat (limited to 'gmap_arcgis.js')
-rw-r--r--gmap_arcgis.js11
1 files changed, 5 insertions, 6 deletions
diff --git a/gmap_arcgis.js b/gmap_arcgis.js
index a7da5a9..f28106a 100644
--- a/gmap_arcgis.js
+++ b/gmap_arcgis.js
@@ -35,20 +35,20 @@ function gmap_arcgis() {
// Get an existing GMap instance using Drupal GMap Module API
map = Drupal.gmap.getMap(id).map;
- gmapArcgisShowPolygons(Drupal.settings.gmap_arcgis.polygons);
+ gmapArcgisShowPolygons(map, Drupal.settings.gmap_arcgis.polygons);
}, 5);
}
// Show all defined polygons
-function gmapArcgisShowPolygons(polygons) {
+function gmapArcgisShowPolygons(map, polygons) {
for (j = 0; j < polygons.length; j++) {
- showPolygon(polygons[j]);
+ showPolygon(map, polygons[j]);
}
}
// Hide all defined polygons
-function gmapArcgisHidePolygons(polygons) {
+function gmapArcgisHidePolygons(map, polygons) {
for (j = 0; j < polygons.length; j++) {
polygons[j].overlay.setOpacity(0);
unblockUI();
@@ -56,7 +56,7 @@ function gmapArcgisHidePolygons(polygons) {
}
// Add polygons from a given ArcGIS MapServer Layer
-function showPolygon(polygon) {
+function showPolygon(map, polygon) {
var defaultOpacity = 0.55;
if (typeof polygon.overlay != 'undefined') {
@@ -75,7 +75,6 @@ function showPolygon(polygon) {
}
});
- blockUI();
polygon.overlay.setMap(map);
polygon.overlay.setOpacity(defaultOpacity);