Vector rendering example
There is a ton of room for optimization here. The vector layer renderer should only render dirty areas and could maintain a cache of rendered canvas tiles. The vector source could have a simple spatial index for features (by tile coord). Need to also discuss how to work with this animation framework (to avoid the excess work while waiting for tiles to load on every other layer).
This commit is contained in:
@@ -155,8 +155,10 @@ ol.renderer.canvas.VectorLayer.prototype.renderFrame =
|
||||
filter = filters[i];
|
||||
type = filter.getType();
|
||||
features = source.getFeatures(filter);
|
||||
symbolizer = symbolizers[type];
|
||||
canvasRenderer.renderFeaturesByGeometryType(type, features, symbolizer);
|
||||
if (features.length) {
|
||||
symbolizer = symbolizers[type];
|
||||
canvasRenderer.renderFeaturesByGeometryType(type, features, symbolizer);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user