smas1 / geoext-viewer

Automatically exported from code.google.com/p/geoext-viewer
GNU General Public License v3.0
0 stars 0 forks source link

several WFS requests do not work in IE11 #378

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Start the Sublayers example
2. Click a WFS layer of the USA states

What is the expected output? What do you see instead?
No States are visible.

In Fiddler the XML of the WFS Request in IE11 is different from IE10. An extra 
namespace is inserted: 'xmlns:NS1=""' and 'NS1:xmlns:feature=' instead of 
'xmlns:feature='

This is an OpenLayers IE11 problem, a solution for this problem is described at:
http://osgeo-org.1560.x6.nabble.com/WFS-and-IE-11-td5090636.html

Original issue reported on code.google.com by Martijn....@gmail.com on 23 May 2014 at 10:09

GoogleCodeExporter commented 9 years ago
Issue 379 has been merged into this issue.

Original comment by Martijn....@gmail.com on 23 May 2014 at 10:28

GoogleCodeExporter commented 9 years ago
Potential solution is described in 
http://osgeo-org.1560.x6.nabble.com/WFS-and-IE-11-td5090636.html

    /* 
    Override for bug with IE11: an extra NS1 namespace is inserted in the WFS-request XML. This extra namespace is not valid and causes an error on execution.
    If multiple operations are send in a single operation namespaces NS2, NS3 and so on, are generated by IE11. The regular expression takes care of this.

    Heron Issue #378

    */

    var _class = OpenLayers.Format.XML;

    var originalWriteFunction = _class.prototype.write;

    var patchedWriteFunction = function()
    {
        var child = originalWriteFunction.apply( this, arguments );

        // NOTE: Remove the rogue namespaces as one block of text.
        //       The second fragment "NS1:" is too small on its own and could cause valid text (in, say, ogc:Literal elements) to be erroneously removed.
        child = child.replace(new RegExp('xmlns:NS\\d+="" NS\\d+:', 'g'), '');

        return child;
    }

    _class.prototype.write = patchedWriteFunction;

Original comment by Martijn....@gmail.com on 23 May 2014 at 10:30

GoogleCodeExporter commented 9 years ago
The above fix is apllied to the formatting result, but in OpenLayers this 
problem was also found and fixed in the OpenLayers master branch (due for 
v2.14), see the commits in this Pull Request

https://github.com/openlayers/openlayers/commit/821975c1f500e26c6663584356db5d65
b57f70d9

I think the proper fix for Heron in override-openlayers.js is to import the 
fixes for the protocols WFS (3 versions), SOS and CSW, though the latter two 
are not yet used by Heron.

Original comment by jus...@gmail.com on 23 May 2014 at 2:00

GoogleCodeExporter commented 9 years ago
Applied the fixes from 
https://github.com/openlayers/openlayers/commit/821975c1f500e26c6663584356db5d65
b57f70d9 into lib/override-openlayers.js. Tested on all IE versions. Confirmed, 
closing this issue.

Original comment by jus...@gmail.com on 3 Jun 2014 at 12:21