On Thu, Jun 26, 2008 at 8:05 PM, Christopher Schmidt
<[EMAIL PROTECTED]> 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.
_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users

Reply via email to