Commit Graph

178 Commits

Author SHA1 Message Date
Tim Schaub
9a0e7a96fe Moving the feature management to the layer
The source will be responsible for fetching vector data.
2013-03-05 18:25:07 +01:00
Tim Schaub
dc19948a85 Get tile size for zoom level (see #258) 2013-03-04 21:30:01 +01:00
ahocevar
f4a4522eb4 Giving vector layers the style they deserve
Now vector layers can have a style. ol.Style instances have an
apply method to get the symbolizer literals for a feature. If the
layer does not have a style defined, there is also a static
applyDefaultStyle function on ol.Style to get the default
symbolizer literals for a feature. The vector layer also got a
groupFeaturesBySymbolizerLiteral method, which returns an array
with features grouped by symbolizer, as needed by the canvas
renderer.
2013-03-02 17:38:01 +01:00
Tim Schaub
438664a190 Renaming literals 2013-02-19 22:35:29 -07:00
Tim Schaub
46e31f9f9a Lint and names 2013-02-18 22:20:50 -07:00
Tim Schaub
ce4b95f960 Decoupling canvas tile grid from vector source grid
If we have a gridded vector source, the grid should have something to do with the source data (e.g. the vector data is available in a regular grid).  The vector layer renderer's internal grid is for rendering canvas tiles and doesn't have anything to do with the source.
2013-02-18 17:54:13 -07:00
Tim Schaub
e9fb83d4ee Use post render frame for tile pruning
We should discuss whether post render functions must be run after each render frame or not.  If these can be run after multiple render frames, it would make sense to increase the timeout.  As it is, it looks like post render functions are run for every render.  Hard to see what the benefit is in this case.
2013-02-18 11:58:43 -07:00
Tim Schaub
2082ba7637 Fewer, bigger tiles 2013-02-13 15:51:06 -07:00
ahocevar
e155f870cd Fixing RTree, and using it for retrieving geometries 2013-02-13 12:29:14 +01:00
Tim Schaub
5bbd8fd9f3 Using ol.TileCache for managing canvas tiles 2013-02-06 18:23:39 -07:00
Tim Schaub
11b8c0ff47 Don't generate new tiles while animating 2013-02-06 17:47:03 -07:00
ahocevar
619803cdeb More goog.requires fixes 2013-02-06 16:36:42 +01:00
ahocevar
61e4452c83 Adding missing and removing unused goog.requires 2013-02-06 16:26:24 +01:00
ahocevar
43dd9ca68c Don't use unshift 2013-02-02 12:29:08 +01:00
ahocevar
e61c26830e Manage tile cache
This change implements a LRU policy for tile cachint, and keeps
128 tiles in the cache by default.
2013-01-30 17:09:43 +01:00
ahocevar
65b3bb70a1 Some optimizations
* Tiles are now cut out of the sketch renderer in a separate
  pass. This ensures that point features at tile borders appear
  at both sides of the border. However, if such features get
  added in a later tileRange rendering pass, tiles from a
  previous rendering pass will still not have that feature.
* The tile canvas is only created once, and cloneNode(false) is
  used to get a canvas for a new tile.
2013-01-25 16:46:12 +01:00
Tim Schaub
4e3f984796 Properly rendering features to canvas tiles
It looks like this approach will work well for panning (as anticipated).  For animated zooming, it is not going to work as is.  It looks like the canvas tile generation is too much for this type of animation loop.  Though there are clearly still areas for optimization:

 * Don't create new tiles while animating between zoom levels.  Using existing tiles only while animating should bring a significant performance gain.
 * Simple spatial index for tiles - each tile coord in the matrix could have a feature lookup object (keyed by id).  This needs to account for rendered dimension (as witnessed by the point being cut by a tile).  Given that the current example uses only three features, adding the spatial index should only be a minor improvement.
 * Reuse a fixed set of canvas tiles that are generated at construction (and increased/decreased with view size changes).
 * If a fixed set of tiles is not used, at least new ones could be cloned from existing ones (minor).
 * Do some profiling to look for more ideas.

In addition, world-wrapping needs addressed.  I don't think this renderer is the right (or at least the only) place to address this.  And the cache of tiles needs to be managed for real.  But hey, at least we've got a working tiled vector renderer now.
2013-01-24 21:57:12 -07:00
Tim Schaub
f2b325b430 Adding convenient tile labels for debugging
This will be removed when behavior is right.
2013-01-24 17:16:54 -07:00
Tim Schaub
033daa425b Reverting b0a7badc8f
I think it's complicating things at this point to deal with this.  Unfortunately, it's not proper dateline wrapping as is (only arbitrary tile range extent wrapping).
2013-01-24 17:15:32 -07:00
ahocevar
b0a7badc8f Started on proper date line wrapping
What we want in the end is vector tiles repeated just as raster
tiles. This change only avoids repeated tiles with the same
content being rendered and stored in the cache.
2013-01-24 17:29:21 +01:00
ahocevar
fe605ceebb Better, but still not all the way there 2013-01-24 16:21:30 +01:00
Tim Schaub
9bd1ab99d1 Toward tiled vector rendering 2013-01-24 02:06:40 -07:00
ahocevar
4a54cc69ce Tiled vector rendering
This needs more work still - see inline TODOs. It also has a
major bug - rendered vector features do not scale and do not
change their offset during panning. So only the initial view is
correct.
2013-01-23 21:37:06 +01:00
Tim Schaub
35f6984e69 Unused var and some notes 2013-01-22 11:21:35 -07:00
ahocevar
4e6b864e27 Making default symbolizers compiler safe 2013-01-22 14:09:04 +01:00
Tim Schaub
c50fcecf42 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).
2013-01-22 01:46:27 -07:00
Tim Schaub
1dd17fc88f Rendering vector layers 2013-01-22 01:36:32 -07:00
Tim Schaub
0f33561af2 Skeleton canvas renderer for vector layer 2013-01-21 18:02:28 -07:00