Ticket #1222 (closed feature: fixed)
IE reports a JS error when refreshing page while drawing a feature
| Reported by: | elemoine | Owned by: | |
|---|---|---|---|
| Priority: | blocker | Milestone: | 2.6 Release |
| Component: | Renderer.VML | Version: | SVN |
| Keywords: | Cc: | ||
| State: | Complete |
Description
Andrew de Klerk reported a problem with IE: we get javascript errors when refreshing the page (F5 or Ctrl+F5) while in the process of drawing a feature.
crschmidt's words for describing the issue:
If you are *currently* in the process of drawing a new feature, and you refresh the page, then the Map.destroy function which is called on page onunload loops through the controls and destroys them. The Control calls the Handler destroy, which calls the handler deactivate() method, which (in the Point handler) calls the this.cancel() if drawing is true, which then calls this.layer.renderer.clear()... ... But because the controls are destroyed *after* the layers in the map destroy() function, the layer has already been destroyed, and it has no renderer property, which means that IE throws an error. I can reproduce this in IE7. Someone should file this as a bug, and we should write a test for it. The test should look like: var handler = new OpenLayers.Handler.Point(); handler.activate(); handler.layer.destroy(); handler.deactivate(); Though in a quick test inside Firebug lite, new OpenLayers.Handler() returns undefined, so I'm probably missing something more important. This should be a blocker for 2.6.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

