[OpenLayers-Users] IE7 Error when adding vector layer

Derek Watling derek at cmainfo.co.za
Fri Aug 14 05:00:36 EDT 2009


I am having problems with IE7 when adding a vector layer to the map.

I am using ASP.NET with a Master page and a custom build of OpenLayers 2.8.
The begining of my Master page is as follows:

<%@ Master Language="VB" CodeFile="CMAMaster.master.vb"
Inherits="MasterPage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
    ...

The OpenLayers.js is then included in the ScriptManagerProxy for the pages
that require it.

Everything works perfectly in IE8, Firefox and Safari with these settings.
However IE7 usually (but not always) gives an "Unspecified error". If I
remove the vector layer from the map it works fine in IE7.

The code to add the vector layer is:
...
    var SPStyle = {
        strokeColor: 'red',
        strokeWidth: 2,
        fillColor: 'red',
        fillOpacity: '0.15',
        borderStyle: 'solid'
    }

    SPLayer = new OpenLayers.Layer.Vector("Subject Property");
    SPLayer.displayInLayerSwitcher = false;
    SPLayer.style = SPStyle;
    map.addLayer(SPLayer);
...

Any help on how to work around this issue would be greatly appreciated.
-- 
View this message in context: http://n2.nabble.com/IE7-Error-when-adding-vector-layer-tp3443849p3443849.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.



More information about the Users mailing list