[OpenLayers-Users] LineString in Vectorlayer doesn't get rendered in Firefox

Armin arminus at gmail.com
Mon Jul 2 01:32:45 PDT 2012


Hi,

I have a strange issue with Firefox. The following snippet works well in
Chrome 20, but doesn't in Firefox 13 (with openlayers 2.12), i.e. the
LineString is not visible:

    var theLayer = new OpenLayers.Layer.Vector("Route", {
        rendererOptions: {yOrdering: true},
        styleMap: new OpenLayers.StyleMap({'default':{
            fillOpacity: 1.0
        }})
    });
    map.addLayer(theLayer);

...

    var geometry = new OpenLayers.Geometry.LineString(polyPoints);
    var routePolyLine = new OpenLayers.Feature.Vector(geometry, null, {
        strokeColor: color,
        strokeOpacity: opacity,
        strokeWidth: sWidth
    });

    theLayer.addFeatures(routePolyLine);

The difference I notice is that after having called addFeatures, in the DOM
in Firefox, theLayer.unrenderedFeatures contains the entire vector (i.e. a
copy of or reference to theLayer.features[0]), while in Chrome
theLayer.unrenderedFeatures is null.

theLayer.reportError is set to true but I don't get any errors in the
console.

I also tried
    theLayer.drawFeature(routePolyLine);
    theLayer.refresh();
after the addFeature, no change, the poly line doesn't appear in Firefox.

Any ideas ?

Thanks,
Armin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20120702/650ed8d5/attachment.html>


More information about the Users mailing list