yourcelf / olwidget

Javascript library to replace textareas that contain WKT data with editable OpenLayers maps, and a django app using it for django forms and admin.
Other
91 stars 44 forks source link

Edit toolbar buttons missing in IE8 with OL 2.11 #108

Closed mivanov closed 11 years ago

mivanov commented 12 years ago

The edit toolbar buttons don't show up in IE8. Tested using http://docs.olwidget.org/en/latest/_static/examples/simple.html Other browsers seem unaffected.

We encountered this in LocalWiki after switching to OL 2.11. The toolbar does show up when using olwidget with OL 2.10. More info, as well as the first bad commit in OL that breaks this here: https://github.com/localwiki/localwiki/issues/286

mivanov commented 12 years ago

Screenshot: http://dl.dropbox.com/u/4921196/screenshots/olwidget_ie8_missing_buttons.png

tiuma commented 12 years ago

I'm not an IE user, but i experienced this issue last week over a windows machine. There is a workaround for this bug:

  1. Click on "Edit".
  2. Over the map, make a click. Shoud appear the cross to draw.
  3. Then, double click over the mapa. Shoud appear the entire toolbar.

Also, we have a fix, but i havent here at hand. Later, i will comment that fix.

tiuma commented 12 years ago

To fix this bug, over line 1043 from olwidget.js comment the following statement:

//begin comment if (this.map.selectControl) { this.map.selectControl.deactivate(); } //end comment

I don't know if this fix, come with other issues. Seems to work...

mivanov commented 12 years ago

@8ksoft thanks for the suggestion, but the workaround and fix you suggested don't seem to work

elpaso commented 11 years ago

You can try this:

at the end of setEditing

   // ABP: fix ugly MSIE errors on editing toolbar disappear:
    // ABP: bind event listeners to drawFeature controls activation event
    for(var i=0; i < this.panel.controls.length; i++){          
        this.panel.controls[i].events.register('activate', this, function(evt){
            this.panel.redraw();
        });
    }
philipn commented 11 years ago

@elpaso This looks like it fixes the issue! PR here: https://github.com/yourcelf/olwidget/pull/116