[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 14:25:27 EDT 2008


On Thu, Jun 26, 2008 at 8:05 PM, Christopher Schmidt
<crschmidt at metacarta.com> wrote:
> On Thu, Jun 26, 2008 at 07:54:23PM +0200, Andreas Hocevar wrote:
>> 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.
>
> If we were going to do this, I'd say we should instead use
> geometry.getBounds() and map.getBounds() and check intersectsBounds() on
> them, rather than using the (more expensive) geometry.intersects(),
> since mostly what we care about here is bbox intersection.


Absolutely right. So the less expensive second workaround would look like this:

vectorLayer.renderer.drawFeature = function(feature, style) {

    if(feature.geometry.getBounds().intersectsBounds(
            feature.layer.map.getExtent())) {

        OpenLayers.Renderer.prototype.drawFeature.apply(this, arguments);

    }

};


Chris, should I create a ticket? We might want to do some profiling
before moving this to trunk though.

Regards,
Andreas.



More information about the Users mailing list