[OpenLayers-Users] Delete polygon/line vertices in IE

Oscar Fonts oscar.fonts.lists at gmail.com
Wed Jun 11 13:44:22 EDT 2008


Kirsten,

This code will work, at least for ModifyFeature in IE6 & IE7 (just changed
"window" to "document", see #1108):

// Patch on Keyboard Handler for IE
OpenLayers.Handler.Keyboard.prototype.activate = function() {
    if (OpenLayers.Handler.prototype.activate.apply(this, arguments)) {
        for (var i = 0; i < this.KEY_EVENTS.length; i++) {
            OpenLayers.Event.observe(
                document, this.KEY_EVENTS[i], this.eventListener);
        }
        return true;
    } else {
        return false;
    }
};

OpenLayers.Handler.Keyboard.prototype.deactivate = function() {
    var deactivated = false;
    if (OpenLayers.Handler.prototype.deactivate.apply(this, arguments)) {
        for (var i = 0; i < this.KEY_EVENTS.length; i++) {
            OpenLayers.Event.stopObserving(
                document, this.KEY_EVENTS[i], this.eventListener);
        }
        deactivated = true;
    }
    return deactivated;
};


Working example: http://www.icc.cat/vissir2/?lang=en_UK => measure tools.
I don't know how to create/use patches, yet.

Oscar.


2008/6/11 Christopher Schmidt <crschmidt at metacarta.com>:

> On Wed, Jun 11, 2008 at 10:48:27AM +0200, Kirsten Grimm [geOps] wrote:
> > Hello,
> > when trying to delete polygon or line vertices with the ModifyFeature
> > Control in  IE7, nothing happens,  the  keypress event isn't fired.  In
> > FF everything works fine. Is there a solution for this problem?
>
> No, but there is a Trac ticket -- and patches are welcome.
>
>  #864
>     KeyboardDefaults broken in IE
>  #1292
>     keyboardDefaults broken in Safari 3
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20080611/1f4d01a9/attachment.html


More information about the Users mailing list