[OpenLayers-Dev] WFS Layer loadstart/loadend events missing in moveTo()

Roald de Wit rdewit at users.sourceforge.net
Mon Oct 1 20:51:15 EDT 2007


Hi List,

Maybe I'm overlooking something, but it seems that in the method
moveTo() the following monotoring hook is missing after line 259 in
Layer/WFS.js (SVN trunk: revision 4744)

                        this.addTileMonitoringHooks(this.tile);

A current tile is destroyed and a new tile is created, but not getting
the monitoring hooks before being drawn. This results in the
loadstart/loadend events not being triggered.

It seems that the code there is a bit double anyway. Wouldn't something
like this be a cleaner?


            // Destroy tile first if exists
            if (this.tile) {
                if (this.vectorMode) {
                    this.destroyFeatures();
                    this.renderer.clear();
                } else {
                    this.clearMarkers();
                }    
                this.removeTileMonitoringHooks(this.tile);
                this.tile.destroy();
            }

            //(re)create tile
            this.tile = null; // do we need to do this??
            this.tile = new OpenLayers.Tile.WFS(this, pos, tileBounds, 
                                                 url, tileSize);
            this.addTileMonitoringHooks(this.tile); 
            this.tile.draw();

Can this be fixed in the 2.5 release?

Greetings, Roald




More information about the Dev mailing list