From f834929710043c4013eec1cf869446a7bf8c895b Mon Sep 17 00:00:00 2001 From: Silvio Date: Tue, 12 Mar 2013 17:18:55 -0300 Subject: Cleanup --- gmap_arcgis.js | 10 ++++++---- 1 file 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) { -- cgit v1.2.3