And more, the clone mothed will make more parseFloat call.<br><br clear="all">Li XinGang<br>EMail: <a href="mailto:slinavlee@gmail.com">slinavlee@gmail.com</a><br>Blog: <a href="http://avlee.cnblogs.com">avlee.cnblogs.com</a><br>
Site: <a href="http://www.mapboost.org">www.mapboost.org</a><br>
<br><br><div class="gmail_quote">On Fri, Oct 22, 2010 at 8:03 PM, Andreas Hocevar <span dir="ltr"><<a href="mailto:ahocevar@opengeo.org">ahocevar@opengeo.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Now why wait for 3.0? This can easily be wrapped into OpenLayers.Class (and that's what I was hoping for when I meant "OpenLayers.Class has room for improvement"). I have just created <a href="http://trac.osgeo.org/openlayers/ticket/2899" target="_blank">http://trac.osgeo.org/openlayers/ticket/2899</a>.<br>
<br>
Some results with the patch I have attached to that ticket, which basically turns OpenLayers.Class into "Pure JavaScript":<br>
<br>
Safari 5:<br>
OpenLayers.Class 15.65<br>
Pure JavaScript 19.1<br>
Object Litteral 13.7<br>
<br>
Firefox 3.6.10:<br>
OpenLayers.Class 63.7<br>
Pure JavaScript 60.15<br>
Object Litteral 62.1<br>
<br>
Regards,<br>
<font color="#888888">Andreas.<br>
</font><div><div></div><div class="h5"><br>
On Oct 22, 2010, at 10:36 , Andreas Hocevar wrote:<br>
<br>
> Alright. Sorry, I had missed your initial posting that contained all this.<br>
><br>
> /me should not raise voice without reading the whole thread thoroughly.<br>
><br>
> The part that I had missed was that your proposal was to get rid of OpenLayers.Class entirely. I agree that this change makes more sense than working around an expensive instantiation through OpenLayers.Class.<br>
><br>
> Thanks,<br>
> Andreas.<br>
><br>
> On Oct 22, 2010, at 10:12 , Eric Lemoine wrote:<br>
><br>
>> On Friday, October 22, 2010, Andreas Hocevar <<a href="mailto:ahocevar@opengeo.org">ahocevar@opengeo.org</a>> wrote:<br>
>>> It will be good to see this "pure JS" approach in action, with actual code. Especially how subclassing and instanceof checking for any class in the inheritance chain would work.<br>
>><br>
>> Just look at my OpenLayers.inherit function and the examples I provided.<br>
>><br>
>> Basically;<br>
>><br>
>> P = function() {<br>
>> };<br>
>> P.prototype = {<br>
>> };<br>
>> p = new P;<br>
>> p instanceof P;<br>
>><br>
>> C = function() {<br>
>> P.call(this);<br>
>> };<br>
>> OpenLayers.inherit(C, P, {<br>
>> });<br>
>> c = new C;<br>
>> c instanceof C;<br>
>> c instanceof P;<br>
>><br>
>> --<br>
>> Eric Lemoine<br>
>><br>
>> Camptocamp France SAS<br>
>> Savoie Technolac, BP 352<br>
>> 73377 Le Bourget du Lac, Cedex<br>
>><br>
>> Tel : 00 33 4 79 44 44 96<br>
>> Mail : <a href="mailto:eric.lemoine@camptocamp.com">eric.lemoine@camptocamp.com</a><br>
>> <a href="http://www.camptocamp.com" target="_blank">http://www.camptocamp.com</a><br>
>> _______________________________________________<br>
>> Dev mailing list<br>
>> <a href="mailto:Dev@lists.osgeo.org">Dev@lists.osgeo.org</a><br>
>> <a href="http://lists.osgeo.org/mailman/listinfo/openlayers-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-dev</a><br>
><br>
> --<br>
> Andreas Hocevar<br>
> OpenGeo - <a href="http://opengeo.org/" target="_blank">http://opengeo.org/</a><br>
> Expert service straight from the developers.<br>
><br>
> _______________________________________________<br>
> Dev mailing list<br>
> <a href="mailto:Dev@lists.osgeo.org">Dev@lists.osgeo.org</a><br>
> <a href="http://lists.osgeo.org/mailman/listinfo/openlayers-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-dev</a><br>
<br>
--<br>
Andreas Hocevar<br>
OpenGeo - <a href="http://opengeo.org/" target="_blank">http://opengeo.org/</a><br>
Expert service straight from the developers.<br>
<br>
_______________________________________________<br>
Dev mailing list<br>
<a href="mailto:Dev@lists.osgeo.org">Dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/openlayers-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-dev</a><br>
</div></div></blockquote></div><br>