File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -670,14 +670,22 @@ App.prototype.getBearing = function(callback) {
670670 */
671671App . prototype . clear = function ( callback ) {
672672 var self = this ;
673- var overlayIDs = Object . keys ( OVERLAYS ) ;
674- var overlayId ;
675- for ( var i = 0 ; i < overlayIDs . length ; i ++ ) {
676- overlayId = overlayIDs [ i ] ;
677- OVERLAYS [ overlayId ] . off ( ) ;
678- delete OVERLAYS [ overlayId ] ;
679- }
680- OVERLAYS = { } ;
673+
674+ var clearObj = function ( obj ) {
675+ var ids = Object . keys ( obj ) ;
676+ var id ;
677+ for ( var i = 0 ; i < ids . length ; i ++ ) {
678+ id = ids [ i ] ;
679+ obj [ id ] . off ( ) ;
680+ delete obj [ id ] ;
681+ }
682+ obj = { } ;
683+ } ;
684+
685+ clearObj ( OVERLAYS ) ;
686+ clearObj ( MARKERS ) ;
687+ clearObj ( KML_LAYERS ) ;
688+
681689 cordova . exec ( function ( ) {
682690 if ( typeof callback === "function" ) {
683691 callback . call ( self ) ;
You can’t perform that action at this time.
0 commit comments