OpenLayers OpenLayers

Changeset 2104

Show
Ignore:
Timestamp:
12/28/06 04:30:30 (2 years ago)
Author:
bertil
Message:

graphic attributes are now set with css

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sandbox/camptocamp/advancedcontrol/examples/vector.html

    r1981 r2104  
    1616 
    1717        function init() { 
    18             //console.log(OpenLayers.Event); 
    19              
    20             var toolbar = new OpenLayers.Control.EditingToolbar(); 
    2118            var navigation = new OpenLayers.Control.MouseDefaults(); 
    2219             
    23             // the info is an option of the selection. 
    24             var selection = new OpenLayers.Control.EditingTool.Selection(); 
    25             var movePathPoint = new OpenLayers.Control.EditingTool.MovePathPoint(); 
    26             var editingAttributes = new OpenLayers.Control.EditingAttributes(); 
    27             var rotate = new OpenLayers.Control.EditingTool.Rotate(); 
    28             var drawPoint = new OpenLayers.Control.EditingTool.DrawPoint(); 
    29             var drawLineString = new OpenLayers.Control.EditingTool.DrawLineString(); 
    30             var drawLinearRing = new OpenLayers.Control.EditingTool.DrawLinearRing(); 
    31             var removePathPoint = new OpenLayers.Control.EditingTool.RemovePathPoint(); 
    32             var addPathPoint = new OpenLayers.Control.EditingTool.AddPathPoint(); 
    33             toolbar.addTools([navigation, selection, editingAttributes, movePathPoint, drawPoint, drawLineString, drawLinearRing, addPathPoint, removePathPoint, rotate]); 
    34              
    35             map = new OpenLayers.Map('map', {controls: [ 
    36                 toolbar, 
    37                 editingAttributes, 
    38                 new OpenLayers.Control.LayerSwitcher(), 
    39                 new OpenLayers.Control.PanZoom() 
    40             ]}); 
     20            map = new OpenLayers.Map('map', {theme: "tango"}); 
    4121             
    4222            vector = new OpenLayers.Layer.Vector("Vector Layer"); 
     
    4424 
    4525            map.addLayers([vector, ol_wms]); 
     26             
     27            map.resetMouseListeners(); 
     28            map.addMouseListener(new OpenLayers.Control.MouseListener.Selection()); 
    4629           
    4730            //map.addControl(new OpenLayers.Control.LayerSwitcher()); 
  • sandbox/camptocamp/advancedcontrol/lib/OpenLayers.js

    r2081 r2104  
    111111        "OpenLayers/Control/MouseListener.js", 
    112112        "OpenLayers/Control/MouseDefaults.js", 
     113        "OpenLayers/Control/EditingTool/Selection.js", 
    113114        "OpenLayers/Control/PanZoom.js", 
    114115        "OpenLayers/Control/ArgParser.js", 
  • sandbox/camptocamp/advancedcontrol/lib/OpenLayers/Control.js

    r2081 r2104  
    1212    id: null, 
    1313     
    14     /** this gets set in the addControl() function in OpenLayers.Map 
    15     * @type OpenLayers.Map */ 
     14    /** @type OpenLayers.Map */ 
    1615    map: null, 
    1716 
    1817    /** @type DOMElement */ 
    1918    div: null, 
    20  
    21     /** @type OpenLayers.Pixel */ 
    22     position: null, 
    23  
    24     /** @type OpenLayers.Pixel */ 
    25     mouseDragStart: null, 
    26      
    27     /** @type String */ 
    28     theme: null, 
    2919 
    3020    /** 
     
    3626        this.id = this.id?this.id:OpenLayers.Util.createUniqueID(this.CLASS_NAME + "_"); 
    3727        this.controlName = this.controlName?this.controlName:"olControl"; 
     28         
     29        options = options || []; 
    3830        OpenLayers.Util.extend(this, options); 
    3931    }, 
     
    6355     * @type DOMElement 
    6456     */ 
    65     draw: function (px) { 
     57    draw: function () { 
    6658        if (this.div == null) { 
    6759            this.div = document.createElement("div"); 
     
    7062            this.div.className = this.controlName; 
    7163        } 
    72         if (px != null) { 
    73             this.position = px.clone(); 
    74         } 
    75         this.moveTo(this.position); 
    7664        return this.div; 
    7765    },    
    78  
    79     /** 
    80      * @param {OpenLayers.Pixel} px 
    81      */ 
    82     moveTo: function (px) { 
    83         if ((px != null) && (this.div != null)) { 
    84             this.div.style.left = px.x + "px"; 
    85             this.div.style.top = px.y + "px"; 
    86         } 
    87     }, 
    8866 
    8967    /** 
  • sandbox/camptocamp/advancedcontrol/lib/OpenLayers/Control/Button.js

    r2085 r2104  
    1414     
    1515    icon: null, 
    16      
    17     actionListeners: null, 
    1816     
    1917    /** 
     
    3735     * @type DOMElement 
    3836     */ 
    39     draw: function (px) { 
     37    draw: function () { 
    4038        if (this.div == null) { 
    4139            this.div = document.createElement("button"); 
     
    5149        } 
    5250         
    53         if (px != null) { 
    54             this.position = px.clone(); 
    55         } 
    56          
    57         this.moveTo(this.position); 
    58          
    5951        return this.div; 
    6052    }, 
  • sandbox/camptocamp/advancedcontrol/lib/OpenLayers/Control/Checkbox.js

    r2085 r2104  
    1212     
    1313    name: null, 
    14      
    15     icon: null, 
    16      
    17     actionListeners: null, 
    1814     
    1915    /** 
     
    3733     * @type DOMElement 
    3834     */ 
    39     draw: function (px) { 
     35    draw: function () { 
    4036        if (this.div == null) { 
    4137            this.div = document.createElement("input"); 
     
    4440            this.div.id = this.id; 
    4541            this.div.className = this.controlName; 
    46         } 
    47         if (px != null) { 
    48             this.position = px.clone(); 
    49         } 
    50         this.moveTo(this.position); 
    51          
     42        }         
    5243        return this.div; 
    5344    }, 
  • sandbox/camptocamp/advancedcontrol/lib/OpenLayers/Control/Choice.js

    r2085 r2104  
    1313    name: null, 
    1414     
    15     icon: null, 
     15    group: null, 
    1616     
    1717    actionListeners: null, 
     
    3838     * @type DOMElement 
    3939     */ 
    40     draw: function (px) { 
     40    draw: function () { 
    4141        if (this.div == null) { 
    4242            this.div = document.createElement("input"); 
     
    4646            this.div.name = this.group; 
    4747            this.div.className = this.controlName; 
    48         } 
    49         if (px != null) { 
    50             this.position = px.clone(); 
    51         } 
    52         this.moveTo(this.position); 
    53          
     48        }         
    5449        return this.div; 
    5550    }, 
  • sandbox/camptocamp/advancedcontrol/lib/OpenLayers/Control/Container.js

    r2081 r2104  
    1212 
    1313    contentDiv: null, 
    14  
    15     controls: null, 
    1614     
    1715    /** 
  • sandbox/camptocamp/advancedcontrol/lib/OpenLayers/Control/EditingTool/Selection.js

    r2041 r2104  
    99 */ 
    1010 
    11 OpenLayers.Control.EditingTool.Selection = OpenLayers.Class.create(); 
    12 OpenLayers.Control.EditingTool.Selection.prototype = OpenLayers.Class.inherit( OpenLayers.Control.EditingTool, { 
     11OpenLayers.Control.MouseListener.Selection = OpenLayers.Class.create(); 
     12OpenLayers.Control.MouseListener.Selection.prototype = OpenLayers.Class.inherit( OpenLayers.Control.MouseListener, { 
    1313 
    1414    /** @type String */ 
     
    2727    */ 
    2828    initialize: function() { 
    29         OpenLayers.Control.EditingTool.prototype.initialize.apply(this, arguments); 
     29        OpenLayers.Control.MouseListener.prototype.initialize.apply(this, arguments); 
    3030        this.style = OpenLayers.Style.DefaultRendererSelectionStyle; 
    3131        this.editingModes = []; 
     
    5858     * @param {Event} evt 
    5959     */ 
    60     defaultMouseDown: function(evt) { 
     60    mouseDown: function(evt) { 
    6161        // Double click manager 
    6262        if (this.lastDown && this.lastDown.x  == evt.xy.x && this.lastDown.y == evt.xy.y) { 
     
    6565        this.lastDown = evt.xy; 
    6666         
    67         OpenLayers.Control.EditingTool.prototype.defaultMouseDown.apply(this, arguments); 
     67        OpenLayers.Control.EditingTool.prototype.mouseDown.apply(this, arguments); 
    6868             
    6969        // Display Feature attributes 
     
    115115     * @param {Event} evt 
    116116     */ 
    117     defaultMouseMove: function (evt) { 
    118         OpenLayers.Control.EditingTool.prototype.defaultMouseMove.apply(this, arguments); 
     117    mouseMove: function (evt) { 
     118        OpenLayers.Control.EditingTool.prototype.mouseMove.apply(this, arguments); 
    119119         
    120120        this.eraseTmpElements(); 
     
    161161     * @param {Event} evt 
    162162     */ 
    163     defaultMouseUp: function (evt) { 
    164         OpenLayers.Control.EditingTool.prototype.defaultMouseUp.apply(this, arguments); 
     163    mouseUp: function (evt) { 
     164        OpenLayers.Control.EditingTool.prototype.mouseUp.apply(this, arguments); 
    165165         
    166166        // TBD check if this is working 
     
    173173     * @param {Event} evt 
    174174     */ 
    175     defaultKeyDown: function(evt){ 
     175    keyDown: function(evt){ 
    176176        OpenLayers.Control.EditingTool.prototype.defaultKeyDown.apply(this, arguments); 
    177177         
  • sandbox/camptocamp/advancedcontrol/lib/OpenLayers/Control/Image.js

    r2081 r2104  
    2727        this.alt = alt; 
    2828         
    29         if (options) { 
    30             OpenLayers.Control.prototype.initialize.apply(this, options); 
    31         } 
     29        options = options || []; 
     30        OpenLayers.Control.prototype.initialize.apply(this, options); 
    3231    }, 
    3332     
     
    3837     * @type DOMElement 
    3938     */ 
    40     draw: function (px) { 
     39    draw: function () { 
    4140        if (this.div == null) { 
    4241            this.div = OpenLayers.Util.createImagesDomElement(this.image, this.map.theme); 
     
    4544            this.div.alt = this.alt; 
    4645            this.div.className = this.controlName; 
    47         } 
    48          
    49         if (px != null) { 
    50             this.position = px.clone(); 
    51         } 
    52          
    53         this.moveTo(this.position); 
    54          
     46        }         
    5547        return this.div; 
    5648    }, 
  • sandbox/camptocamp/advancedcontrol/lib/OpenLayers/Control/Label.js

    r2085 r2104  
    1212     
    1313    name: null, 
    14      
    15     icon: null, 
    1614     
    1715    actionListeners: null, 
     
    3634     * @type DOMElement 
    3735     */ 
    38     draw: function (px) { 
     36    draw: function () { 
    3937        if (this.div == null) { 
    4038            this.div = document.createElement("label"); 
     
    4644            this.div.appendChild(document.createTextNode(this.name)); 
    4745            this.div.className = this.controlName; 
    48         } 
    49         if (px != null) { 
    50             this.position = px.clone(); 
    51         } 
    52         this.moveTo(this.position); 
    53          
     46        }         
    5447        return this.div; 
    5548    }, 
  • sandbox/camptocamp/advancedcontrol/lib/OpenLayers/Control/LayerSwitcher.js

    r2085 r2104  
    3333        this.background.className = this.controlName+"Background"; 
    3434        this.div.insertBefore(this.background, this.div.childNodes[0]); 
    35                 
     35         
    3636        this.header = document.createElement("div"); 
    3737        this.header.className = this.controlName+"Header";