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

Tim-Hinnerk Heuer th.heuer at gmail.com
Tue Mar 13 17:51:11 EDT 2012


Hi List,

Intro: I'm Tim-Hinnerk Heuer, a web developer at Landcare Research New
Zealand. I've been to the last FOSS4G in Denver and I'm a committer on
MapFish Print, but mainly a JavaScript-Front-End-Developer. I've learned a
lot about JavaScript in the past years and even developed an OpenLayers
extension to OpenLayers.Layer.WMS called OpenLayers.Layer.VideoWMS. You can
find that at my GitHub @ http://github.com/geekdenz/openlayers . Haven't
made a pull request yet, because it might not be stable yet...

The real reason for my post is (hope this is the right place to post this):

I've come across an error/exception in OpenLayers, that seems to be pretty
new (using the latest git master version):

In Chrome:
Uncaught Error: NOT_FOUND_ERR: DOM Exception 8
In Firefox:
Node was not found
Around line 26075 (in my own built version).
I guess line 702 in Layer/Grid.js in the latest build

Code around it:
    /**
     * Method: removeBackBuffer
     * Remove back buffer from DOM.
     */
    removeBackBuffer: function() {
        if(this.backBuffer) {
            this.div.removeChild(this.backBuffer); // THIS IS THE LINE
            this.backBuffer = null;
            this.backBufferResolution = null;
            if(this.backBufferTimerId !== null) {
                window.clearTimeout(this.backBufferTimerId);
                this.backBufferTimerId = null;
            }
        }
    },

Part of the stack trace is:

OpenLayers.Layer.Grid.OpenLayers.Class.removeBackBuffer
OpenLayers.Layer.Grid.OpenLayers.Class.applyBackBuffer
OpenLayers.Layer.Grid.OpenLayers.Class.moveTo
OpenLayers.Map.OpenLayers.Class.moveTo
OpenLayers.Map.OpenLayers.Class.setCenter
OpenLayers.Control.OpenLayers.Class.wheelChange
...

It happens when I zoom about in our map or when I open the Print Window,
which has another map in it. It's only really a problem in the print
window, because the whole map breaks. In the normal map it is not a problem
so much, because you only occasionally see that error in the developer
tools or Firebug.

This problem only got introduced recently but I don't know through which
change. I suspect it has something to do with how I initialize the print
window. It's using GeoExt's SimplePrint class and quite a bit of custom
code. (On a side note the print window has been in the app for ages.)

It is also only happening when I quickly zoom about and then open the print
map, not when I wait for everything to load.

I suspect it has something to do with the fact that the print window has an
extra vector layer with a rectangle of where the to be printed map is and
that it gets set as the base layer. However, I tried explicitly removing it
and adding it later and also tried to do a map.setBaseLayer(myBaseLayer) to
no avail. In fact that line throws the same error.

Please help if you can, this bug has been annoying me for quite some time
now already.

Thanks,
Tim

Twitter: @timhheuer
Blog: http://www.thheuer.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-dev/attachments/20120314/197959cd/attachment.html


More information about the Dev mailing list