[OpenLayers-Dev] Exception in OpenLayers.Layer.Grid.removeBackBuffer

Andreas Hocevar ahocevar at opengeo.org
Wed Mar 14 03:08:19 EDT 2012


The only occasions I could think of that could potentially make
this.backBuffer both non-null and not a child of this.div is when a
layer is cloned during tile loading, or when the layer is added to a
second map without cloning it. The latter would be an application bug,
the former an OpenLayers one.

Andreas.

On Wed, Mar 14, 2012 at 6:16 AM, Eric Lemoine
<eric.lemoine at camptocamp.com> wrote:
>
>
> On Wednesday, March 14, 2012, Tim-Hinnerk Heuer <th.heuer at gmail.com> wrote:
>> Hi Eric,
>> I couldn't reproduce the problem in any simple example. However, I did fix
>> it within OpenLayers. Basically, I changed a couple of lines:
>>     /**
>>      * Method: removeBackBuffer
>>      * Remove back buffer from DOM.
>>      */
>>     removeBackBuffer: function() {
>>         if(this.backBuffer) {
>>             if (this.div.hasChildNodes(this.backBuffer)) { // ADDED THIS
>> LINE
>>                 this.div.removeChild(this.backBuffer);
>>             } // AND OF COURSE THIS
>>             this.backBuffer = null;
>>             this.backBufferResolution = null;
>>             if(this.backBufferTimerId !== null) {
>>                 window.clearTimeout(this.backBufferTimerId);
>>                 this.backBufferTimerId = null;
>>             }
>>         }
>>     },
>> It's in my public repo. Should I make a pull request? I know it's yet
>> another check and might slow down things, but stability seems more
>> important. What do you think?
>
>
> I'm sure this fixes it. The thing is I really don't understand how
> this.backBuffer can be both non-null and not a child of this.div. I think
> this should never occur. It may occur there's some code that empties the
> layer div without calling removeBackBuffer beforehands, but the lib does not
> have such code as far as I know.
>
>
> --
> 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.lemoine at camptocamp.com
> http://www.camptocamp.com
>
>
> _______________________________________________
> Dev mailing list
> Dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-dev
>



-- 
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.


More information about the Dev mailing list