[OpenLayers-Users] Cannot upgrade to 2.6 because of vector lines disappearing in IE (Frustrated)

Andreas Hocevar andreas.hocevar at gmail.com
Thu Jun 26 13:54:23 EDT 2008


Ok, I did some investigation.

The reason why this testcase fails is that the two features are far
away from each other. So the SVG renderer will find that the
coordinates are not in valid range (because too large), and the VML
renderer fails for reasons not clear to me.

Two separate workarounds are needed, one for IE and one for FF. In IE,
we have to modify renderer.drawFeature to only draw features that
intersect the map extent. The FF workaround is to just return always
true in renderer.inValidRange. Be warned that the FF workaround will
likely cause FF2 to crash, but as I hear from Linda, her users do not
use FF anyway.

Ok, attached is a working version of the test case. The relevant code
snippet (to be put in the init function, after instantiation of the
vector layer) is:

vectorLayer.renderer.inValidRange = function() {
    return true;
};
vectorLayer.renderer.drawFeature = function(feature, style) {
    if(!feature.geometry.intersects(feature.layer.map.getExtent().toGeometry()))
{
        return;
    }
    OpenLayers.Renderer.prototype.drawFeature.apply(this, arguments);
};


We might consider to add the second workaround to trunk, because it
will reduce the number of features to be rendered. On the other hand,
the intersects check is quite expensive.

Linda, please let us know if this fix works for you.

Regards,
Andreas.

On Wed, Jun 18, 2008 at 10:59 PM, Eric Lemoine <eric.c2c at gmail.com> wrote:
> On Wed, Jun 18, 2008 at 10:48 PM, Eric Lemoine <eric.c2c at gmail.com> wrote:
>> Hi,
>>
>> On FF2 the line disappears on zoom #16. The line disappears in
>> drawLineString() (SVG.js) when calling setAttributeNS(). I couldn't
>> get any further.
>
> The problem comes from the fact SVG.inValidRange() returns false. Hope
> that can help you debug this Andreas.
>
> --
> Eric
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20080626/ba7a4c2e/smalltestcase.html


More information about the Users mailing list