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

Andreas Hocevar ahocevar at opengeo.org
Mon Jul 2 02:56:28 PDT 2012


This is probably because your feature spans a very large area of the
world. Firefox has a limited range of coordinate values, so there is
some extra logic in the SVG renderer to split geometries, which does
not catch all cases. As a workaround, you may want to try the Canvas
renderer instead.

Andreas.

On Mon, Jul 2, 2012 at 10:32 AM, Armin <arminus at gmail.com> wrote:
> 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
>
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>



-- 
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.


More information about the Users mailing list