Re: [OpenLayers-Dev] 2.10 and 2.11-RC1 OpenLayers.Class behavior changes

2011-08-08 Thread RICHARD Didier
> On Mon, Aug 8, 2011 at 7:34 AM, Eric Lemoine > wrote: >>> Hi Eric, >> >> Hi Didier >> >> I have added tests for your usage patterns. See >> . >> >>> With your proposed patch, I am very happy (for the moment, my tests are >>> working, but I still

Re: [OpenLayers-Dev] 2.10 and 2.11-RC1 OpenLayers.Class behavior changes

2011-08-08 Thread Eric Lemoine
On Mon, Aug 8, 2011 at 7:34 AM, Eric Lemoine wrote: >> Hi Eric, > > Hi Didier > > I have added tests for your usage patterns. See > . > >> With your proposed patch, I am very happy (for the moment, my tests are >> working, but I still have some iss

Re: [OpenLayers-Dev] 2.10 and 2.11-RC1 OpenLayers.Class behavior changes

2011-08-07 Thread Eric Lemoine
> Hi Eric, Hi Didier I have added tests for your usage patterns. See . > With your proposed patch, I am very happy (for the moment, my tests are > working, but I still have some issues --surely be related to 2.10 to 2.11 > port in our Geoportal's

Re: [OpenLayers-Dev] 2.10 and 2.11-RC1 OpenLayers.Class behavior changes

2011-08-07 Thread RICHARD Didier
> On Sun, Aug 7, 2011 at 12:01 AM, Eric Lemoine > wrote: >> On Sat, Aug 6, 2011 at 9:32 PM, RICHARD Didier >> wrote: >>> 2/ in test 4, if you remove the initialize function from B and overload A, the B constructor is still the previous A's constructor. >>

Re: [OpenLayers-Dev] 2.10 and 2.11-RC1 OpenLayers.Class behavior changes

2011-08-07 Thread RICHARD Didier
> On Sat, Aug 6, 2011 at 9:32 PM, RICHARD Didier > wrote: >> >>> >>> 2/ in test 4, if you remove the initialize function from B and >>> overload >>> A, >>> the B constructor is still the previous A's constructor. >> >> Yes. To address this one I see no other solution than

Re: [OpenLayers-Dev] 2.10 and 2.11-RC1 OpenLayers.Class behavior changes

2011-08-07 Thread Eric Lemoine
On Sun, Aug 7, 2011 at 12:01 AM, Eric Lemoine wrote: > On Sat, Aug 6, 2011 at 9:32 PM, RICHARD Didier wrote: >> >>> >>> 2/ in test 4, if you remove the initialize function from B and >>> overload >>> A, >>> the B constructor is still the previous A's constructor. >> >> Yes

Re: [OpenLayers-Dev] 2.10 and 2.11-RC1 OpenLayers.Class behavior changes

2011-08-06 Thread Eric Lemoine
On Sat, Aug 6, 2011 at 9:32 PM, RICHARD Didier wrote: > >> >> 2/ in test 4, if you remove the initialize function from B and >> overload >> A, >> the B constructor is still the previous A's constructor. > > Yes. To address this one I see no other solution than patching

Re: [OpenLayers-Dev] 2.10 and 2.11-RC1 OpenLayers.Class behavior changes

2011-08-06 Thread RICHARD Didier
> > 2/ in test 4, if you remove the initialize function from B and > overload > A, > the B constructor is still the previous A's constructor. Yes. To address this one I see no other solution than patching OpenLayers.Class. See the patch attached to this email, and my

Re: [OpenLayers-Dev] 2.10 and 2.11-RC1 OpenLayers.Class behavior changes

2011-08-03 Thread RICHARD Didier
2/ in test 4, if you remove the initialize function from B and overload A, the B constructor is still the previous A's constructor. >>> >>> Yes. To address this one I see no other solution than patching >>> OpenLayers.Class. See the patch attached to this email, and my >>> test

Re: [OpenLayers-Dev] 2.10 and 2.11-RC1 OpenLayers.Class behavior changes

2011-08-03 Thread Eric Lemoine
>>> 2/ in test 4, if you remove the initialize function from B and overload >>> A, >>> the B constructor is still the previous A's constructor. >> >> Yes. To address this one I see no other solution than patching >> OpenLayers.Class. See the patch attached to this email, and my >> test_overload_5 t

Re: [OpenLayers-Dev] 2.10 and 2.11-RC1 OpenLayers.Class behavior changes

2011-08-02 Thread Eric Lemoine
On Tue, Aug 2, 2011 at 7:32 PM, RICHARD Didier wrote: > >>> 2/ in test 4, if you remove the initialize function from B and overload >>> A, >>> the B constructor is still the previous A's constructor. >> >> Tell me if I'm wrong but this case doesn't work with OL 2.10 either. >> So no "regression" h

Re: [OpenLayers-Dev] 2.10 and 2.11-RC1 OpenLayers.Class behavior changes

2011-08-02 Thread RICHARD Didier
>> 2/ in test 4, if you remove the initialize function from B and overload >> A, >> the B constructor is still the previous A's constructor. > > Tell me if I'm wrong but this case doesn't work with OL 2.10 either. > So no "regression" here, right? > Yeap, but you're fuzzing over many points !-) A

Re: [OpenLayers-Dev] 2.10 and 2.11-RC1 OpenLayers.Class behavior changes

2011-08-02 Thread Eric Lemoine
> 2/ in test 4, if you remove the initialize function from B and overload A, > the B constructor is still the previous A's constructor. Tell me if I'm wrong but this case doesn't work with OL 2.10 either. So no "regression" here, right? -- Eric Lemoine Camptocamp France SAS Savoie Technolac, BP

Re: [OpenLayers-Dev] 2.10 and 2.11-RC1 OpenLayers.Class behavior changes

2011-08-02 Thread RICHARD Didier
>> This test has been ran on FF successfully. > > I haven't looked at your tests into detail, but do mean your problems > are now solved? > no, just meant it works with OL 2.11 under FF ... I have got problems with OL 2.10 ! Regards, didier > -- > Eric Lemoine > > Camptocamp France SAS > Savoi

Re: [OpenLayers-Dev] 2.10 and 2.11-RC1 OpenLayers.Class behavior changes

2011-08-02 Thread Eric Lemoine
> This test has been ran on FF successfully. I haven't looked at your tests into detail, but do mean your problems are now solved? -- Eric Lemoine Camptocamp France SAS Savoie Technolac, BP 352 73377 Le Bourget du Lac, Cedex Tel : 00 33 4 79 44 44 96 Mail : eric.lemo...@camptocamp.com http://w

Re: [OpenLayers-Dev] 2.10 and 2.11-RC1 OpenLayers.Class behavior changes

2011-08-02 Thread RICHARD Didier
>>> Really not sure : I am still stuck with constructor modifications (when >>> sub-classes use the same constructor as the superclass whose initialize >>> method is beeing modified) in the class hierarchy in OL 2.11 rc1. I had >>> no >>> problem with OL 2.10 ... >> >> Could you please provide a s

Re: [OpenLayers-Dev] 2.10 and 2.11-RC1 OpenLayers.Class behavior changes

2011-08-01 Thread Eric Lemoine
>> Really not sure : I am still stuck with constructor modifications (when >> sub-classes use the same constructor as the superclass whose initialize >> method is beeing modified) in the class hierarchy in OL 2.11 rc1. I had no >> problem with OL 2.10 ... > > Could you please provide a small test c

Re: [OpenLayers-Dev] 2.10 and 2.11-RC1 OpenLayers.Class behavior changes

2011-08-01 Thread Eric Lemoine
On Mon, Aug 1, 2011 at 11:30 PM, RICHARD Didier wrote: > >> On Sun, Jul 24, 2011 at 11:38 PM, Andreas Hocevar >> wrote: >>> Hi Didier, >>> >>> not sure if you've seen my follow-up mail. You need to re-assign the >>> protoype after the snippet I posted. So the whole snippet would be: >>> >>> var X

Re: [OpenLayers-Dev] 2.10 and 2.11-RC1 OpenLayers.Class behavior changes

2011-08-01 Thread RICHARD Didier
> On Sun, Jul 24, 2011 at 11:38 PM, Andreas Hocevar > wrote: >> Hi Didier, >> >> not sure if you've seen my follow-up mail. You need to re-assign the >> protoype after the snippet I posted. So the whole snippet would be: >> >> var X= OpenLayers.Class({ >>   initialize:function() { this._p= "A.ini

Re: [OpenLayers-Dev] 2.10 and 2.11-RC1 OpenLayers.Class behavior changes

2011-08-01 Thread Eric Lemoine
On Sun, Jul 24, 2011 at 11:38 PM, Andreas Hocevar wrote: > Hi Didier, > > not sure if you've seen my follow-up mail. You need to re-assign the protoype > after the snippet I posted. So the whole snippet would be: > > var X= OpenLayers.Class({ >   initialize:function() { this._p= "A.initialize"; >

Re: [OpenLayers-Dev] 2.10 and 2.11-RC1 OpenLayers.Class behavior changes

2011-07-28 Thread Andreas Hocevar
Hi, what about this: var A = OpenLayers.Class({...}); var B = OpenLayers.Class(A, {...}); var OverloadB = { initialize: function() { alert("OverloadB"); }, customMethod: function() {...}, customProperty: "foo" }; var proto = B.prototype; B = OverloadB.initialize; B.protot

Re: [OpenLayers-Dev] 2.10 and 2.11-RC1 OpenLayers.Class behavior changes

2011-07-28 Thread Richard Didier
Le mercredi 27 juillet 2011 11:39:17, Richard Didier a écrit : > Le mardi 26 juillet 2011 11:52:10, Andreas Hocevar a écrit : > > Hi Richard, > > Hi Andreas, > > > Also, please let me know if you're able to override constructors in 2.11 > > with this approach: > > > > var A = OpenLayers.Class({.

Re: [OpenLayers-Dev] 2.10 and 2.11-RC1 OpenLayers.Class behavior changes

2011-07-27 Thread Richard Didier
Le mardi 26 juillet 2011 11:52:10, Andreas Hocevar a écrit : > Hi Richard, > Hi Andreas, > Also, please let me know if you're able to override constructors in 2.11 > with this approach: > > var A = OpenLayers.Class({...}); > var B = OpenLayers.Class(A, {...}); > > OverloadB = { > initializ

Re: [OpenLayers-Dev] 2.10 and 2.11-RC1 OpenLayers.Class behavior changes

2011-07-26 Thread Richard Didier
Le mardi 26 juillet 2011 11:52:10, Andreas Hocevar a écrit : > Hi Richard, > Hi Andreas, > one note about license and patents: OpenLayers 2.11 is released under a > simplified license, which does not contain any language about patent > rights. See http://openlayers.org/blog/2011/05/17/simplified

Re: [OpenLayers-Dev] 2.10 and 2.11-RC1 OpenLayers.Class behavior changes

2011-07-26 Thread Andreas Hocevar
Hi Richard, one note about license and patents: OpenLayers 2.11 is released under a simplified license, which does not contain any language about patent rights. See http://openlayers.org/blog/2011/05/17/simplified-license/ Also, please let me know if you're able to override constructors in 2.11

Re: [OpenLayers-Dev] 2.10 and 2.11-RC1 OpenLayers.Class behavior changes

2011-07-26 Thread Richard Didier
Le mardi 26 juillet 2011 10:57:23, Andreas Hocevar a écrit : > Hi Didier, > Andreas, > > > > The rational is many fold : > > > > 1/ There are tickets for the next OL release that we incorporate directly > > in our production scripts. Usually, we try to push fixes every three > > months and a n

Re: [OpenLayers-Dev] 2.10 and 2.11-RC1 OpenLayers.Class behavior changes

2011-07-26 Thread Andreas Hocevar
Hi Didier, see replies inline. On Jul 26, 2011, at 09:41 , Richard Didier wrote: >> The problem here is that A becomes a subclass of itself. So what you could >> try instead to avoid this is > > That's the reason why I have written OpenLayers.overload to avoid this > problem. In OL 2.10, it is

Re: [OpenLayers-Dev] 2.10 and 2.11-RC1 OpenLayers.Class behavior changes

2011-07-26 Thread Richard Didier
Le lundi 25 juillet 2011 23:39:50, Andreas Hocevar a écrit : > Hi Didier, > > So what you implemented with your overload method results in the same as if > you'd simply use OpenLayers.Class: > > A = A.overload(A, { > initialize:function() { > this.p_= "A.initialize-new"; > Ope

Re: [OpenLayers-Dev] 2.10 and 2.11-RC1 OpenLayers.Class behavior changes

2011-07-25 Thread Andreas Hocevar
Hi Didier, So what you implemented with your overload method results in the same as if you'd simply use OpenLayers.Class: A = A.overload(A, { initialize:function() { this.p_= "A.initialize-new"; OpenLayers.Console.info(this.p_); }, pa:"PA-new" }); is equivalent to

Re: [OpenLayers-Dev] 2.10 and 2.11-RC1 OpenLayers.Class behavior changes

2011-07-25 Thread RICHARD Didier
> Hi Didier, > Hi Andreas, > what I showed you in the last snippet is exactly what happens in > OpenLayers.Class. So to do it the way we recommend, and if you're into > anonymous functions, you could do something like the following, which is > 100% OpenLayers API compliant: > > var X = OpenLayer

Re: [OpenLayers-Dev] 2.10 and 2.11-RC1 OpenLayers.Class behavior changes

2011-07-24 Thread christopher.schmidt
On Jul 24, 2011, at 4:07 PM, ext Schuyler Erle wrote: > > On Jul 24, 2011, at 4:43 AM, RICHARD Didier wrote: > >> With 2.10, overloading constructors was as simple as overwriting the >> initialize prototype : >> >> X.prototype.initialize= function () { ...} >> >> In 2.11-RC1, it breaks as the

Re: [OpenLayers-Dev] 2.10 and 2.11-RC1 OpenLayers.Class behavior changes

2011-07-24 Thread Andreas Hocevar
Hi Didier, what I showed you in the last snippet is exactly what happens in OpenLayers.Class. So to do it the way we recommend, and if you're into anonymous functions, you could do something like the following, which is 100% OpenLayers API compliant: var X = OpenLayers.Class({ initialize:

Re: [OpenLayers-Dev] 2.10 and 2.11-RC1 OpenLayers.Class behavior changes

2011-07-24 Thread RICHARD Didier
> Sorry, missed to add the last line. So the working example would be: > > var X= OpenLayers.Class({ >initialize:function() { this._p= "A.initialize"; > OpenLayers.Console.info(this._p); }, >pa:"PA", >p_:null, >ma:function() { OpenLayers.Console.info("A.ma="+this.pa); } > }); > xPr

Re: [OpenLayers-Dev] 2.10 and 2.11-RC1 OpenLayers.Class behavior changes

2011-07-24 Thread Andreas Hocevar
Hi Didier, not sure if you've seen my follow-up mail. You need to re-assign the protoype after the snippet I posted. So the whole snippet would be: var X= OpenLayers.Class({ initialize:function() { this._p= "A.initialize"; OpenLayers.Console.info(this._p); }, pa:"PA", p_:null, ma:fun

Re: [OpenLayers-Dev] 2.10 and 2.11-RC1 OpenLayers.Class behavior changes

2011-07-24 Thread RICHARD Didier
> Hi Richard, > > you are right of course, my bad. You would have to re-assign the prototype > of the old class, which gets lost when you re-assign X. Something like > > var X= OpenLayers.Class({ >initialize:function() { this._p= "A.initialize"; > OpenLayers.Console.info(this._p); }, >pa:"

Re: [OpenLayers-Dev] 2.10 and 2.11-RC1 OpenLayers.Class behavior changes

2011-07-24 Thread Andreas Hocevar
Sorry, missed to add the last line. So the working example would be: var X= OpenLayers.Class({ initialize:function() { this._p= "A.initialize"; OpenLayers.Console.info(this._p); }, pa:"PA", p_:null, ma:function() { OpenLayers.Console.info("A.ma="+this.pa); } }); xProto = X.prototype; x

Re: [OpenLayers-Dev] 2.10 and 2.11-RC1 OpenLayers.Class behavior changes

2011-07-24 Thread Andreas Hocevar
Hi Richard, you are right of course, my bad. You would have to re-assign the prototype of the old class, which gets lost when you re-assign X. Something like var X= OpenLayers.Class({ initialize:function() { this._p= "A.initialize"; OpenLayers.Console.info(this._p); }, pa:"PA", p_:null,

Re: [OpenLayers-Dev] 2.10 and 2.11-RC1 OpenLayers.Class behavior changes

2011-07-24 Thread RICHARD Didier
> Hey Schuyler, > > I'm not concerned about breaking backwards compatibility here. We never > encouraged people to override the initialize method by re-assigning it on > the prototype, and we always advertised the initialize method as > constructor. With 2.11, finally, the initialize method is a r

Re: [OpenLayers-Dev] 2.10 and 2.11-RC1 OpenLayers.Class behavior changes

2011-07-24 Thread Andreas Hocevar
Hey Schuyler, I'm not concerned about breaking backwards compatibility here. We never encouraged people to override the initialize method by re-assigning it on the prototype, and we always advertised the initialize method as constructor. With 2.11, finally, the initialize method is a real const

Re: [OpenLayers-Dev] 2.10 and 2.11-RC1 OpenLayers.Class behavior changes

2011-07-24 Thread Schuyler Erle
On Jul 24, 2011, at 4:43 AM, RICHARD Didier wrote: > With 2.10, overloading constructors was as simple as overwriting the > initialize prototype : > > X.prototype.initialize= function () { ...} > > In 2.11-RC1, it breaks as the new prototype is not the constructor ! > ... > > BTW, as this new

[OpenLayers-Dev] 2.10 and 2.11-RC1 OpenLayers.Class behavior changes

2011-07-24 Thread RICHARD Didier
Hi devs, With 2.10, overloading constructors was as simple as overwriting the initialize prototype : X.prototype.initialize= function () { ...} In 2.11-RC1, it breaks as the new prototype is not the constructor ! This forces to "re-create" the class when overloading its constructor ... Looking