aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio <silvio@socioambiental.org>2013-04-23 16:29:55 -0300
committerSilvio <silvio@socioambiental.org>2013-04-23 16:29:55 -0300
commita61af1a2ac4ca325c33a4b776bef2f54fcd313e5 (patch)
tree00e6331bf2c677354b4de378d46f78393208fdf2
parentb0582e5bc9d733ac3c4738e73b5efd433d61cca1 (diff)
downloadgmap_arcgis_js-a61af1a2ac4ca325c33a4b776bef2f54fcd313e5.tar.gz
gmap_arcgis_js-a61af1a2ac4ca325c33a4b776bef2f54fcd313e5.tar.bz2
Adds cleanOverlays() method
-rw-r--r--gmap_arcgis.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/gmap_arcgis.js b/gmap_arcgis.js
index b1b2cff..ec3b44e 100644
--- a/gmap_arcgis.js
+++ b/gmap_arcgis.js
@@ -512,6 +512,21 @@ function gmapArcgis(config) {
}
},
+ // Remove all loaded overlays
+ cleanOverlays: function() {
+ for (overlay in [ 'layers', 'markers' ]) {
+ for (element in this.config[overlay]) {
+ if (this.config[overlay][element].infowindow != undefined) {
+ delete this.config[overlay][element].infowindow;
+ }
+
+ if (this.config[overlay][element].overlay != undefined) {
+ delete this.config[overlay][element].overlay;
+ }
+ }
+ }
+ },
+
// Add panoramio layer
addPanoramio: function() {
if (this.config.panoramio.panoramioLayer == undefined) {