Commit Graph

146 Commits

Author SHA1 Message Date
Tom Payne
e0ef5fc7ee Pass context instead of canvas when creating ol.renderer.canvas.Vector 2013-11-20 11:39:18 +01:00
Tom Payne
2b2e7bf786 Rename ol.renderer.Layer#renderFrame to prepareFrame 2013-11-20 11:31:20 +01:00
ahocevar
0ed208b710 Make renderIntent private and add a getter 2013-11-11 22:07:18 +01:00
Tim Schaub
dbc3109ddb Only call expireTiles_ if already rendered 2013-11-07 10:30:58 -07:00
Tim Schaub
b355c1f412 When expiring tiles, consider max symbol size
When an extent is invalidated, we have to expire tiles outside of that extent to account for symbolizer size.
2013-11-04 13:21:23 -07:00
Tim Schaub
64dd5cfc1f Extend goog.events.Event for custom vector layer events
Vector events include features and extents.  In the case of feature change events, the extents array will include old and new extents for features with modified geometries.w
2013-10-03 11:25:30 -06:00
ahocevar
dbb9525515 No longer group features by geometry type
With symbolizer literals now being geometry type specific, we no
longer need the overhead to query the RTree separately for each
geometry type and render symbolizer groups by geometry type.

The geometry type index of the FeatureCache is no longer needed.

The filtering functionality of the FeatureCache's
getFeaturesObject method can be removed because it is no longer
used.
2013-10-03 08:35:11 -06:00
ahocevar
adc1d130c8 Rename ol.renderer.canvas.VectorRenderer
To be consistent with our naming convention, this one should be
renamed to ol.renderer.canvas.Vector.
2013-10-02 15:58:27 -06:00
ahocevar
3349bded1c Merge pull request #1065 from ahocevar/skip-hidden
Select interaction does not work with shape symbolizers and canvas renderer
2013-09-27 05:45:50 -07:00
Tim Schaub
bbef15e50e Consider resolution when applying rules 2013-09-27 11:46:48 +02:00
ahocevar
c556ddd593 Skip hidden features for hit detection 2013-09-26 12:56:49 +02:00
Tim Schaub
e806f51b3d Changing extent structure back to single array: [minX, minY, maxX, maxY]
This means we'll have to have a new structure and new methods for 3D envelopes.
2013-09-15 00:31:32 -06:00
Tim Schaub
e575df6df0 Canvas renderer updates for new extent structure 2013-09-14 21:13:47 -06:00
ahocevar
83720975f8 More specific INTENTCHANGE instead of SYMBOLIZER event 2013-08-30 12:10:55 +02:00
ahocevar
3a50a754aa Implementing renderIntent handling 2013-08-29 16:50:52 +02:00
Tim Schaub
e9aa316007 Call getUid once 2013-08-27 16:22:45 -06:00
Tim Schaub
6b625e368b Account for icon offsets when doing feature hit detection 2013-08-27 16:22:45 -06:00
Bruno Binet
3ecb5b89ff Create a custom event type for vector layers
Vector layers will now dispatch ol.layer.VectorLayerEventType.ADD and
ol.layer.VectorLayerEventType.REMOVE event types instead of the generic
goog.events.EventType.CHANGE event type.
This will fix a maximum call stack size exceeded javascript error.
2013-08-13 12:27:38 +02:00
ahocevar
781caff9e5 Expire tile by range and listen to changes
Instead of just listening for the first change, we now listen
for all changes, and expire tiles by tile range. The outcome is
that the vector layer's addFeatures and removeFeatures methods
now show instant results on the rendered map.
2013-07-19 14:07:16 +02:00
ahocevar
a9fcc5ff15 Addressing @elemoine's review comments 2013-07-19 13:30:14 +02:00
ahocevar
9095032014 Removing unused methods and changing getFeaturesObjectForExtent
With this change, getFeaturesObjectForExtent may return null if
the source does not have data loaded for the provided extent.
A callback can be passed to getFeaturesObjectForExtent to get
notified when the requested data is available.
2013-07-17 11:28:48 +02:00
Tim Schaub
b04a36ede7 Replace use of filter with expressions
The canvas vector layer still has the (API candidate) `getFeatures` method that accepts an arbitrary expression (was filter).  This, and the `getFeaturesObject` method under it are only used in the tests.  The rendering code that was using filters is now calling `layer.getFeaturesObjectForExtent` with an explicit extent and optional geometry type.
2013-06-25 12:15:33 -06:00
Tim Schaub
20527ab1f1 Reuse tile range 2013-06-24 11:34:59 -06:00
Tim Schaub
a9f01a4390 Use getMetersPer unit method 2013-06-24 11:34:48 -06:00
ahocevar
5cc3e189eb Need to take units into account 2013-06-23 18:48:21 +02:00
ahocevar
af0764b1ca Simpler tile coord access now that we only have one resolution 2013-06-23 18:47:49 +02:00
ahocevar
27c23f676b Fixing requires 2013-06-23 18:47:00 +02:00
ahocevar
1c5f466e61 Adding comment about MIN_RESOLUTION 2013-06-23 18:31:25 +02:00
ahocevar
61fcbd560e Do not render tiles during animation and interaction 2013-06-23 18:31:25 +02:00
ahocevar
f20e6002cc Tile grid and cache for one resolution only 2013-06-23 18:31:25 +02:00
ahocevar
89c23b5560 Use binaryInsert instead of sort 2013-06-23 18:31:25 +02:00
ahocevar
aa62764d90 Do not add resolutions while interacting 2013-06-23 18:31:25 +02:00
ahocevar
0aacf197bf Separate method for updating the tile cache 2013-06-23 18:31:24 +02:00
ahocevar
3afd8b4242 Do not use a fixed tile grid for vector rendering
Instead, we create a new tile grid whenever renderFrame is
called, no animation is active, and the resolution is not in the
tile grid already. This gives better rendering results because
we get vector tiles at native resolutions.
2013-06-23 18:30:57 +02:00
ahocevar
1826b7a9be Merge pull request #808 from ahocevar/no-empty-tiles
Don't render/cache tiles with no features. r=@tschaub
2013-06-23 09:11:55 -07:00
ahocevar
3fc4fc3eb8 Only render and cache tiles that have features 2013-06-23 15:52:31 +02:00
ahocevar
c17424deec Basic support for text symbolizers
This adds basic label rendering for points and polygons to the
canvas renderer, and a text symbolizer to the style package.
2013-06-19 22:01:51 +02:00
ahocevar
ea02626c28 Reducing number of default zoom levels
To avoid issues with long segments, we accept scaled tiles for
now. Further workarounds and browser tickets reporting our
issues are needed.
2013-06-11 21:06:18 +02:00
ahocevar
489459f313 Apply transform to coordinates rather than the canvas
Credit goes to @jystic for figuring out this approach.
2013-06-09 20:20:53 +02:00
ahocevar
3a6c7cf204 Renaming featureInfoFunction to transformFeatureInfo 2013-06-07 15:34:13 +02:00
ahocevar
77d22c4038 getFeatures method and featureInfo templates
To avoid surprises for application developers, this change
creates a new getFeatures method. So it is clear now beforehand
whether features or feature info markup is returned. The result
is now also grouped by layer, so application developers always
have a link between a layer and the feature info it returns.

To make getFeatureInfo return markup for vector layers, this
change also adds a featureInfoFunction property to the vector
layer, which gives developers full control over how features are
rendered to feature info markup.
2013-06-07 15:34:13 +02:00
ahocevar
461d2a1ba8 Merge pull request #756 from ahocevar/extent-equals
Use ol.extent.equals, removing TODO. r=@elemoine
2013-06-01 15:14:20 -07:00
ahocevar
57e36f4eda Use ol.extent.equals, removing TODO 2013-06-01 11:11:13 -06:00
Frederic Junod
a1a7e21f92 Redefine ol.Size to be Array.<number> 2013-06-01 10:22:06 +02:00
Tim Schaub
38752f4700 Properly reset the dirty flag
Currently, the dirty flag is never reset (to false).  This is a bug.  Because renderFrame is called very often (every layer render gets called when every other layer needs to re-render), it is criticial to know when we can bail out early.  The dirty flag is currently the way that the vector layer renderer knows that it needs to do more work.  On an empty cache, the renderFrame method of the vector layer renderer is called ~30 times for a single zoom in the vector layer example (due to tiles loading on other layers).  Without this change, we miss the fast path out and clear/re-render the canvas all 30 times.  With this change, we are only clear the canvas and redraw 6 times in a typical zoom animation.
2013-05-17 23:22:07 -06:00
ahocevar
824397e6ba Do not change ol.extent.containsCoordinate 2013-05-16 10:42:28 +02:00
ahocevar
2d5c0df7cd More verbose variable names 2013-05-16 10:14:56 +02:00
ahocevar
4e7ffc2711 Store symbol sizes by tile
The reason for this change is that symbolSizes and maxSymbolSize
on the instance will be wrong as soon as the resolution changes
and cached tiles are used. It turned out that the approach used
now has several advantages: smaller symbolSizes objects, no need
to merge symbolSizes objects, and cache management for free (no
risk of memory leaks). Note that the symbolSizes and
maxSymbolSize for each tile are not strictly tile specific -
they represent the rendering pass that created the tile. This
has no negative side effects, and it has the advantage that
there is not a single additional loop needed to create these
structures.
2013-05-16 09:57:26 +02:00
ahocevar
037e44e084 Accurate hit detection
With this change, hit detection for lines and points gets very
accurate, because the vector renderer instance keeps track of
line widths and point symbol sizes. After doing a bbox query in
the RTree, returned lines and points are evaluated against the
thresholds of their line width or symbol size. The KML example
with its different symbolizers now has getFeatureInfo too to
show this in action.
2013-05-15 23:44:22 +02:00
ahocevar
7b256c3ec6 Asynchronous API for map#getFeatureInfo
This change allows us to use feature info services on the
server. It will also be useful for the GetFeature control to
get results from a WFS.
2013-05-09 22:26:55 +02:00