OpenLayers OpenLayers

Changeset 2810

Show
Ignore:
Timestamp:
03/16/07 19:05:29 (2 years ago)
Author:
elemoine
Message:

First step towards action history support

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sandbox/elemoine/openlayers/lib/OpenLayers/Control/PanZoom.js

    r2224 r2810  
    113113        if (!OpenLayers.Event.isLeftClick(evt)) return; 
    114114 
     115        var memento = this.map.createMemento(); 
     116        OpenLayers.History.getInstance().addMemento(memento); 
     117 
    115118        switch (this.action) { 
    116119            case "panup":  
  • sandbox/elemoine/openlayers/lib/OpenLayers/Map.js

    r2803 r2810  
    256256         return this.tileSize; 
    257257     }, 
     258 
     259    /** 
     260     * @returns A memento object encapsulating the map state 
     261     * @type OpenLayers.Memento 
     262     */ 
     263    createMemento: function() { 
     264        var bounds = this.getExtent(); // state saved in memento 
     265        return new OpenLayers.Memento.Map(this, bounds); 
     266    }, 
     267 
     268    setMemento: function(memento) { 
     269        var bounds = memento.bounds; // TODO 
     270        this.zoomToExtent(bounds); 
     271    }, 
    258272 
    259273  /********************************************************/