[OpenLayers-Users] Lines disappearing at higer zoom
Eric Lemoine
eric.c2c at gmail.com
Tue Dec 16 16:29:56 EST 2008
On Fri, Dec 12, 2008 at 8:53 PM, Maarten Deen <mdeen at xs4all.nl> wrote:
> Eric Lemoine wrote:
>> So you use 2.7, and possibly found a bug in the lib. Could you please
>> provide the list with a simple example showing the problem?
>
> Sure.
>
> I have a test page at <http://www.maasluip.nl/ebt/test.html>
> It show a series of east-west lines. If you zoom in to a high enough level, the
> lines will disappear, except when you are close enough to the start or end of
> the line. Moving the map closer to the start of the line will make the line
> reappear suddenly.
>
> So I guess it is some sort of "how far is the current point away from the
> starting point, in pixels" bug.
> This occurs on Firefox at zoomlevel 13, but IE is not affected by the bug in
> this example.
> There is another example at <http://www.maasluip.nl/ebt/ebttest.html> with
> longitudal and lateral lines. Here IE also displays the bug, but at different
> zoomlevels than Firefox.
>
> Code to draw the lines on a map is straightforward:
> for (var p=0; p <= 80; p++)
> {
> var pointList = [];
>
> var lonLat0 = new OpenLayers.LonLat(0, p).transform(map.displayProjection,
> map.projection);
> var lonLat1 = new OpenLayers.LonLat(30, p).transform(map.displayProjection,
> map.projection);
> newPoint = new OpenLayers.Geometry.Point(lonLat0.lon, lonLat0.lat);
> pointList.push(newPoint);
> newPoint = new OpenLayers.Geometry.Point(lonLat1.lon, lonLat1.lat);
> pointList.push(newPoint);
>
> var lineFeature = new OpenLayers.Feature.Vector(
> new OpenLayers.Geometry.LineString(pointList));
>
> vectorLayer.addFeatures([lineFeature]);
> }
>
> This will draw one line each 1 degrees of latitude, in a box from (0,0)-(30,80)
It's likely that you hit FF SVG MAX_PIXEL limit [*], which we have no
workaround for at this point;
[*] http://trac.openlayers.org/browser/trunk/openlayers/lib/OpenLayers/Renderer/SVG.js#L35
--
Eric
More information about the Users
mailing list