Commit Graph

79 Commits

Author SHA1 Message Date
Tim Schaub
38b2a46b59 Mark ol.RendererType enum as stable 2014-08-24 18:22:19 -06:00
Frédéric Junod
fa512f1ed0 Merge pull request #2545 from fredj/cleanup
Miscellaneous coding style fixes
2014-08-21 07:44:07 +02:00
Frederic Junod
1439ceafa1 Simplify goog.object.forEach call 2014-08-19 11:58:50 +02:00
Frederic Junod
35e4134047 Don't create unnecessary closure 2014-08-19 11:39:44 +02:00
Tim Schaub
4cf5ab4620 Use @api annotation instead of @todo api 2014-07-05 15:41:14 -04:00
Tim Schaub
b9f444a008 Rename olx.View2DState to olx.ViewState and use viewState property 2014-06-27 09:58:25 -04:00
Éric Lemoine
18d117dff6 Hit detection for features drawn at pre/postcompose 2014-06-25 18:32:02 +02:00
Hadrien Tulipe
7aab28afcc Provide ol.RendererType structure through ol.renderer.Map
It was previously in ol.Map, but it could not be provided because
of circular dependencies.
2014-05-27 22:47:02 +02:00
Hadrien Tulipe
1d6f9ca80b Expose the map renderer type to the public API
In the case  where the map decides itself which renderer to use. It can
be convenient for the developer to have knowledge of the choice made.
2014-05-27 22:47:02 +02:00
Éric Lemoine
8cd5f6d642 Merge pull request #2109 from elemoine/visibleandinrange
Hit detection respects min and maxResolution
2014-05-25 14:43:44 +02:00
Éric Lemoine
fd8a46dcae Hit detection respects min and maxResolution 2014-05-25 14:35:07 +02:00
Andreas Hocevar
eb6a938062 Do not document object literals as interfaces
Instead, object literals with properties that should not be
renamed can go in externs/olx.js.
2014-05-22 15:48:47 +02:00
Tim Schaub
7826036307 Make getLayerStatesArray return an array of layer states 2014-04-04 07:39:54 -06:00
Éric Lemoine
8b0ae9e4da Hit detection skips layers in invisible groups 2014-04-03 16:54:39 +02:00
Tom Payne
022a7a03e0 Use oli.FrameState instead of ol.FrameState 2014-03-10 14:48:23 +01:00
Éric Lemoine
b43dd6db44 Add ol.renderer.Map#scheduleExpireIconCache 2014-02-06 12:59:39 +01:00
Éric Lemoine
e83ec2976f Change forEachFeatureAtPixel arguments names 2014-01-17 11:38:06 +01:00
Éric Lemoine
f7be1c155e Hit detection refactoring
Get the frame state from the map instead of storing values in the layer renderers.
2014-01-14 12:26:49 +01:00
Éric Lemoine
88956c9f5c Merge pull request #1372 from elemoine/vector-api-layer-group
[vector-api] Fix forEachFeatureAtPixel bug
2013-12-15 02:09:44 -08:00
Tom Payne
b59eec7a83 Merge remote-tracking branch 'openlayers/master' into vector-api 2013-12-13 20:22:06 +01:00
Tom Payne
a11c64934c Make ol.renderer.Map a @struct 2013-12-13 18:59:26 +01:00
Éric Lemoine
f79ab25617 Make forEachFeatureAtPixel work with layer groups 2013-12-13 11:58:23 +01:00
Tom Payne
9d57b53c0f Add optional layerFunction to ol.Map#forEachFeatureAtPixel 2013-12-04 00:05:45 +01:00
Tom Payne
e9267e401c Pass layer to forEachFeatureAtPixel callback 2013-12-04 00:05:45 +01:00
Tom Payne
d7591594ca Allow forEachFeatureAtPixel callback to break out of loop 2013-12-04 00:05:44 +01:00
Éric Lemoine
6f423726a9 Add ol.renderer.Map#forEachFeatureAtPixel 2013-12-02 15:06:19 +01:00
Tom Payne
20bd020c13 Use ol.vec.Mat4.makeTransform2D in ol.renderer.Map 2013-12-02 09:57:01 +01:00
ahocevar
b8a9aeb14e Avoid source check in map renderer
By returning true or false from the layer renderer's
getFeatureInfoForPixel method, we know whether the source
supports GetFeatureInfo or not.
2013-11-20 16:05:00 +01:00
ahocevar
0238fa54de The source determines who can do GetFeatureInfo
Now that the ol.renderer.Layer base class has a
getFeatureInfoForPixel method, we have to check whether the
source supports GetFeatureInfo, not the layer renderer.
2013-11-20 13:05:06 +01:00
Frederic Junod
f4c5168cdf Remove renderer.Map#getCanvas function 2013-11-20 11:45:24 +01:00
Tom Payne
bd82e1aa1a Remove vector code from files 2013-11-20 11:41:04 +01:00
Tim Schaub
22da054774 Determine the callback count while iterating through all layers
Previously, if a layer didn't have a `getFeature*ForPixel` type method, the loop count would be decremented.  This means that all layers would not be considered.  Instead, the callback count should be incremented before requests are made and decremented in the callback.
2013-11-13 07:36:54 -07:00
Frederic Junod
ca5960666d Be more strict with {Element} types 2013-11-12 13:53:37 +01:00
ahocevar
5307e5ea3f Until we know what we want to return, return undefined 2013-07-31 11:58:45 +02:00
Tom Payne
1208dab3e9 Fix various type errors related to features 2013-07-22 17:42:47 +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
Frederic Junod
a1a7e21f92 Redefine ol.Size to be Array.<number> 2013-06-01 10:22:06 +02:00
Tom Payne
f64e35e8bb Remove unused variables in renderers 2013-05-28 16:01:33 +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
ahocevar
58c8b07ab5 Get hit candidates from RTree, then refine result
Now we get exact hits also for lines and polygons.
2013-04-30 13:34:12 +02:00
Tom Payne
945d2f6f5d Merge pull request #631 from twpayne/dont-use-foreach-in-loops
Don't use forEach in loops
2013-04-20 03:02:13 -07:00
Tom Payne
fe5c8a97d4 Add ol.renderer.Map#getLayerRendererByKey 2013-04-19 20:22:01 +02:00
Tom Payne
85a95a0036 Call render and requestRenderFrame directly instead of using changed events 2013-04-18 18:58:59 +02:00
Tom Payne
a07e70ea32 Handle obscure edge case where deferred post render function receives a null frame state 2013-04-16 23:40:48 +02:00
Tom Payne
bc10446b0e Track changes to layers in the map 2013-04-16 18:31:59 +02:00
Tom Payne
07fe17924b Remove layer renderers in post render function 2013-04-16 18:16:08 +02:00
Tom Payne
4e69b2bb8b Create and remove layer renderers in renderFrame
Previously, the map renderer would listen for layers being added and
removed from the layers collection, and would create and remove layer
renderers in response to these events.

With this change, layer renderers are only created or removed when
renderFrame is called, which leads to somewhat simpler code.

We still need to listen to changes to the layers collection, but now
these only trigger a new render.

This new approach also has an advantage when layers change order.
Swapping the order of two layers involves removing one and re-inserting
it elsewhere.  With the old approach, this would cause the deletion and
re-creation of the layer renderer.  With this new approach, the layer
renderer is preserved.
2013-04-12 17:50:38 +02:00
Tom Payne
d855a35446 Make renderer layer management private 2013-04-12 00:33:37 +02:00
Tom Payne
f0106f391a Make ol.renderer.Map.map property private 2013-04-12 00:33:37 +02:00
Tom Payne
4be8c991f7 Add missing Closure Library requires 2013-04-06 14:28:12 +02:00