aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gmap_arcgis.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/gmap_arcgis.js b/gmap_arcgis.js
index 1d32441..2257dff 100644
--- a/gmap_arcgis.js
+++ b/gmap_arcgis.js
@@ -63,7 +63,10 @@ function gmapArcgis(config) {
// Add a KML to the map
showKML: function(element) {
- this.config['kmls'][element].overlay = new google.maps.KmlLayer(this.config['kmls'][element].uri);
+ if (typeof this.config['kmls'][element].overlay == 'undefined') {
+ this.config['kmls'][element].overlay = new google.maps.KmlLayer(this.config['kmls'][element].uri);
+ }
+
this.config['kmls'][element].overlay.setMap(this.map);
this.config['kmls'][element].isVisible = true;
},
@@ -71,10 +74,9 @@ function gmapArcgis(config) {
// Add a KML layer into the map
addKML: function(element) {
if (typeof this.config['kmls'][element].overlay != 'undefined') {
- this.config['kmls'][element].overlay.setMap(this.map);
- this.config['kmls'][element].isVisible = true;
+ this.showKML(element);
this.unblockUI();
- return this.config['kmls'][element].overlay;
+ return;
}
if (this.config['kmls'][element].overlayTime != undefined) {