Changeset 83106b6 in osmose-frontend


Ignore:
Timestamp:
Mar 1, 2014 11:08:42 AM (6 years ago)
Author:
Frédéric Rodrigo <fred.rodrigo@…>
Branches:
master
Children:
0d139ae
Parents:
915d7ed
git-author:
Frédéric Rodrigo <fred.rodrigo@…> (18/02/2014 22:44:34)
git-committer:
Frédéric Rodrigo <fred.rodrigo@…> (01/03/2014 11:08:42)
Message:

Don't display markers if layer disabled during ajax query

File:
1 edited

Legend:

Unmodified
Added
Removed
  • static/map/Osmose.Errors.js

    r734537c r83106b6  
    22 
    33  _menu: null, 
     4 
     5  _onMap: false, 
    46 
    57  initialize: function (menu) { 
     
    1315    map.on('moveend', this._updateOsmoseLayerBind, this); 
    1416    this._menu.on('itemchanged', this._updateOsmoseLayerBind, this); 
     17    this._onMap = true; 
    1518    this._updateOsmoseLayer(); 
    1619  }, 
     
    1922    map.off('moveend', this._updateOsmoseLayerBind, this); 
    2023    this._menu.off('itemchanged', this._updateOsmoseLayerBind, this); 
     24    this._onMap = false; 
    2125    this.clearLayers(); 
    2226  }, 
     
    3842      }).done(function (data) { 
    3943        self.clearLayers(); 
    40         self.addLayer(new OsmoseMarker(data)); 
     44        if (self._onMap) { 
     45          self.addLayer(new OsmoseMarker(data)); 
     46        } 
    4147      }); 
    4248    } 
Note: See TracChangeset for help on using the changeset viewer.