[OpenLayers-Users] OpenLayers and IE11 wfs
Ralph Dell
RDell at CatawbaCountyNC.gov
Tue Dec 10 08:35:57 PST 2013
A few weeks ago I posted a problem that I was having with IE11, didn't hear anything back and was able to code an awkward work around for my specific issue
https://www.mail-archive.com/openlayers-users@lists.osgeo.org/msg11768.html
Well yesterday I realized I was having a similar issue with the GetFeature control
I found this solution on the OpenLayers developer list. Thank you Stephen Battey. I am posting it here to make the answer more widely available
http://osgeo-org.1560.x6.nabble.com/WFS-and-IE-11-td5090636.html
We override the write method in the OpenLayers.Format.XML class. After the XML has been generated we do a search-replace on the rogue text in the XML namespace.
Here is the code we run after OpenLayers has loaded:
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:NS1="" NS1:', 'g' ), '' );
return child;
}
_class.prototype.write = patchedWriteFunction;
Ralph Dell
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20131210/3f82b15b/attachment.html>
More information about the Users
mailing list