OpenLayers OpenLayers

Changeset 2840

Show
Ignore:
Timestamp:
03/21/07 16:31:42 (2 years ago)
Author:
elemoine
Message:

first history control bits

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sandbox/elemoine/openlayers/examples/history.html

    r2813 r2840  
    2323            map.setCenter(new OpenLayers.LonLat(lon, lat), zoom); 
    2424 
    25             OpenLayers.History.getInstance().activate(); 
     25            var hist = new OpenLayers.Control.History(); 
     26            map.addControl(hist); 
     27            hist.activate(); 
    2628        } 
    2729 
  • sandbox/elemoine/openlayers/lib/OpenLayers/Control/History.js

    r2810 r2840  
    1010OpenLayers.Control.History = OpenLayers.Class.create(); 
    1111OpenLayers.Control.History.prototype =  
    12   OpenLayers.Class.inherit( OpenLayers.Control, { 
     12    OpenLayers.Class.inherit( OpenLayers.Control, { 
     13   
     14    initialize: function() { 
     15        OpenLayers.Control.Panel.prototype.initialize.apply(this, [{displayClass: "olControlHistory"}]); 
     16    }, 
    1317 
    1418    activate: function() { 
    15         var history = OpenLayers.History.getInstance(); 
    16         history.activate(); 
     19        OpenLayers.History.getInstance().activate(); 
    1720        return OpenLayers.Control.prototype.activate.apply(this,arguments); 
    1821    }, 
    1922 
    2023    deactivate: function() { 
    21         var history = OpenLayers.History.getInstance(); 
    22         history.deactivate(); 
     24        OpenLayers.History.getInstance().deactivate(); 
    2325        return OpenLayers.Control.prototype.deactivate.apply(this,arguments); 
    24     }, 
    25      
    26     draw: function() { 
    27         history.deactivate(); 
    28         this.activate(); 
    2926    }, 
    3027 
  • sandbox/elemoine/openlayers/theme/default/style.css

    r2803 r2840  
    2323    display: block; 
    2424    position: absolute; 
    25 }  
     25
     26.olControlHistory { 
     27    right: 3px; 
     28    display: block; 
     29    position: absolute; 
     30    bottom: 0em; 
     31
    2632 
    2733div.olControlMousePosition { 
     
    8894} 
    8995 
     96 
    9097.olControlNavToolbar .olControlNavigationItemActive {  
    9198  background-image: url("img/panning-hand-on.png");