OpenLayers OpenLayers

Changeset 7253

Show
Ignore:
Timestamp:
05/22/08 10:56:19 (6 months ago)
Author:
elemoine
Message:

get rid of Vector2

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sandbox/camptocamp/unhcr/examples/v2-bbox-wfs-gml.html

    r7057 r7253  
    11<html xmlns="http://www.w3.org/1999/xhtml"> 
    22    <head> 
    3         <title>OpenLayers Vector2 Layer Example</title> 
     3        <title>OpenLayers Vector Behavior Example</title> 
    44        <link rel="stylesheet" href="../theme/default/style.css" type="text/css" /> 
    55        <style type="text/css"> 
     
    2323                ); 
    2424 
    25                 var layer = new OpenLayers.Layer.Vector2("GML", { 
     25                var layer = new OpenLayers.Layer.Vector("GML", { 
    2626                    strategy: new OpenLayers.Strategy.BBOX(), 
    2727                    protocol: new OpenLayers.Protocol.WFS.v1_0_0({ 
     
    4040    </head> 
    4141    <body onload="init()"> 
    42         <h1 id="title">Vector2 Layer Example</h1> 
     42        <h1 id="title">Vector Behavior Example</h1> 
    4343        <p id="shortdesc"> 
    4444            Uses a new strategy, protocol, and format combination. 
  • sandbox/camptocamp/unhcr/examples/v2-fixed-http-gml.html

    r6949 r7253  
    11<html xmlns="http://www.w3.org/1999/xhtml"> 
    22    <head> 
    3         <title>OpenLayers Vector2 Layer Example</title> 
     3        <title>OpenLayers Vector Behavior Example</title> 
    44        <link rel="stylesheet" href="../theme/default/style.css" type="text/css" /> 
    55        <style type="text/css"> 
     
    2121                ); 
    2222 
    23                 var layer = new OpenLayers.Layer.Vector2("GML", { 
     23                var layer = new OpenLayers.Layer.Vector("GML", { 
    2424                    strategy: new OpenLayers.Strategy.Fixed(), 
    2525                    protocol: new OpenLayers.Protocol.HTTP({ 
     
    3737    </head> 
    3838    <body onload="init()"> 
    39         <h1 id="title">Vector2 Layer Example</h1> 
     39        <h1 id="title">Vector Behavior Example</h1> 
    4040        <p id="shortdesc"> 
    4141            Uses a new strategy, protocol, and format combination. 
  • sandbox/camptocamp/unhcr/examples/v2-fixed-wfs-gml.html

    r7055 r7253  
    11<html xmlns="http://www.w3.org/1999/xhtml"> 
    22    <head> 
    3         <title>OpenLayers Vector2 Layer Example</title> 
     3        <title>OpenLayers Vector Behavior Layer Example</title> 
    44        <link rel="stylesheet" href="../theme/default/style.css" type="text/css" /> 
    55        <style type="text/css"> 
     
    2323                ); 
    2424 
    25                 var layer = new OpenLayers.Layer.Vector2("GML", { 
     25                var layer = new OpenLayers.Layer.Vector("GML", { 
    2626                    strategy: new OpenLayers.Strategy.Fixed(), 
    2727                    protocol: new OpenLayers.Protocol.WFS.v1_0_0({ 
     
    4040    </head> 
    4141    <body onload="init()"> 
    42         <h1 id="title">Vector2 Layer Example</h1> 
     42        <h1 id="title">Vector Behavior Layer Example</h1> 
    4343        <p id="shortdesc"> 
    4444            Uses a new strategy, protocol, and format combination. 
  • sandbox/camptocamp/unhcr/examples/v2-wfs-t.html

    r7237 r7253  
    2222             
    2323           /* 
    24             rlayer = new OpenLayers.Layer.Vector2("GML", { 
     24            rlayer = new OpenLayers.Layer.Vector("GML", { 
    2525                    strategy: new OpenLayers.Strategy.BBOX(), 
    2626                    protocol: new OpenLayers.Protocol.WFS.v1_0_0({ 
     
    4242            saveStrategy = new OpenLayers.Strategy.Save(); 
    4343            
    44             clayer = new OpenLayers.Layer.Vector2("GML", { 
     44            clayer = new OpenLayers.Layer.Vector("GML", { 
    4545                    strategies: [new OpenLayers.Strategy.BBOX(), 
    4646                               saveStrategy], 
  • sandbox/camptocamp/unhcr/examples/vector2-wfs-t.html

    r7237 r7253  
    4040            ); 
    4141 
    42             wfs = new OpenLayers.Layer.Vector2("Editable Features", { 
     42            wfs = new OpenLayers.Layer.Vector("Editable Features", { 
    4343                strategies: [new OpenLayers.Strategy.BBOX(), 
    4444                             new OpenLayers.Strategy.Save(), 
  • sandbox/camptocamp/unhcr/examples/vector2.html

    r6919 r7253  
    11<html xmlns="http://www.w3.org/1999/xhtml"> 
    22    <head> 
    3         <title>OpenLayers Vector2 Layer Example</title> 
     3        <title>OpenLayers Vector Behavior Example</title> 
    44        <link rel="stylesheet" href="../theme/default/style.css" type="text/css" /> 
    55        <style type="text/css"> 
     
    2121                ); 
    2222 
    23                 var layer = new OpenLayers.Layer.Vector2("GML", { 
     23                var layer = new OpenLayers.Layer.Vector("GML", { 
    2424                    strategy: new OpenLayers.Strategy.BBOX(), 
    2525                    protocol: new OpenLayers.Protocol.HTTP({ 
     
    3737    </head> 
    3838    <body onload="init()"> 
    39         <h1 id="title">Vector2 Layer Example</h1> 
     39        <h1 id="title">Vector Behavior Example</h1> 
    4040        <p id="shortdesc"> 
    4141            Uses a new strategy, protocol, and format combination. 
  • sandbox/camptocamp/unhcr/lib/OpenLayers.js

    r7237 r7253  
    186186            "OpenLayers/Layer/PointTrack.js", 
    187187            "OpenLayers/Layer/GML.js", 
    188             "OpenLayers/Layer/Vector2.js", 
    189188            "OpenLayers/Strategy.js", 
    190189            "OpenLayers/Strategy/BBOX.js", 
  • sandbox/camptocamp/unhcr/lib/OpenLayers/Layer/Vector.js

    r7085 r7253  
    195195        this.features = []; 
    196196        this.selectedFeatures = []; 
     197 
     198        // assumes if layer has strategy and protocol, then it has a format 
     199        if(this.strategy){ 
     200            this.strategy.setLayer(this); 
     201        } 
     202        if(this.strategies){ 
     203            for(var i = 0; i < this.strategies.length; i++){ 
     204                this.strategies[i].setLayer(this); 
     205            } 
     206        } 
     207        if(this.protocol) { 
     208            this.protocol.layer = this; 
     209            this.protocol.setFormat(this.format); 
     210        } 
    197211    }, 
    198212 
     
    211225        this.geometryType = null; 
    212226        this.drawn = null; 
     227        if (this.protocol) { 
     228            this.protocol.destroy(); 
     229            this.protocol = null; 
     230        } 
     231        if (this.stategies) { 
     232            for(var i = 0; i < this.strategies.length; i++){ 
     233                this.strategies[i].destroy(); 
     234                this.strategies[i] = null; 
     235            } 
     236            this.strategies = null; 
     237        } 
     238        if (this.strategy) { 
     239            this.strategy.destroy(); 
     240            this.strategy = null; 
     241        } 
    213242        OpenLayers.Layer.prototype.destroy.apply(this, arguments);   
    214243    }, 
     
    259288            this.renderer.setSize(this.map.getSize()); 
    260289        } 
     290        if(this.strategy) { 
     291            this.strategy.commit(); 
     292            this.strategy.update(); 
     293        } 
     294        if(this.strategies) { 
     295            for(var i = 0; i < this.strategies.length; i++){ 
     296                this.strategies[i].commit(); 
     297                this.strategies[i].update(); 
     298            } 
     299        } 
    261300    }, 
    262301