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:
Tim Schaub
2013-01-22 01:46:27 -07:00
parent 1dd17fc88f
commit c50fcecf42
3 changed files with 65 additions and 2 deletions

View File

@@ -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);
}
}
};