Commit Graph

450 Commits

Author SHA1 Message Date
Tom Payne
11672db967 Use === and !== for comparisons with 0 2013-05-28 16:07:48 +02:00
Tom Payne
f64e35e8bb Remove unused variables in renderers 2013-05-28 16:01:33 +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
7a800068ed Fixing typedef 2013-05-16 10:44:22 +02: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
Tom Payne
b070b572d0 Rename ol.extent.createEmptyExtent to ol.extent.createEmpty 2013-05-01 12:36:54 +02:00
Tom Payne
2690410cbe Improve type checking in ol.renderer.Layer 2013-04-30 22:00:22 +02:00
Tom Payne
59a4155651 Merge pull request #665 from twpayne/fix-firefox-dom-renderer
Prevent Bootstrap's setting of max-width from infecting map
2013-04-30 06:46:41 -07:00
Tom Payne
2d83003b64 Merge pull request #671 from twpayne/refactor-tile-functions
Refactor tile functions
2013-04-30 06:39:25 -07: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
ahocevar
cc1b70c74b Giving the map a getFeatureInfoForPixel method
This method is an entry point for getting feature information.
Renderers can use a hit canvas or defer to a layer (source) to
get matching features for a pixel.

For now this is only implemented for vector layers, and it uses
a bbox query because we cannot refine the result because of
missing geometry intersection functions yet.
2013-04-30 13:32:16 +02:00
Tom Payne
7ed672752d Merge pull request #668 from twpayne/strip-debug-classes
Strip debug classes when compiling
2013-04-30 03:30:05 -07:00
Tom Payne
daa975d01f Prevent user's setting of max-width from infecting map
Thanks @ThomasG77.
2013-04-30 12:26:31 +02:00
Tom Payne
66d95316f1 Merge pull request #666 from twpayne/remove-unused-css-classes
Remove unused CSS classes
2013-04-30 02:33:50 -07:00
Tom Payne
6976fd96e3 Refactor tile functions
* Add support for minZoom in XYZ tile grids and tile sources
* Factor out common tile coordinate transforms
2013-04-29 19:54:26 +02:00
Tom Payne
1ff8df8936 Log WebGL shader and program errors 2013-04-29 12:51:16 +02:00
Tom Payne
5bfef2805d Merge pull request #663 from twpayne/render-error-tiles-as-empty
Render error tiles as empty
2013-04-28 08:21:51 -07:00
Tom Payne
ef915e1cd0 Remove unused CSS classes
The classes ol-layers, ol-layer-image, and ol-layer-tile are not used.
2013-04-28 16:40:17 +02:00
Frederic Junod
b3e5ac2717 Optimize canvas renderer.
Only use setTransform when it's needed (ie. when the view is rotated)
2013-04-26 13:32:18 +02:00
Tom Payne
d8a4b19b54 Render error tiles as empty 2013-04-25 14:49:55 +02:00
Frederic Junod
4094ace04b Remove BACKGROUND_COLOR from ol.Map
Let the map be transparent, the background color can be set with CSS.
2013-04-24 17:38:25 +02:00
Tom Payne
1a72e59c54 Fix stray return 2013-04-23 16:42:39 +02:00
Tom Payne
a85363ac03 Use negative frame index as frame marker to avoid conflict with goog.getUid 2013-04-23 15:22:49 +02:00
Éric Lemoine
4f1b7c70b8 Remove unused function 2013-04-21 21:50:03 +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
ac557d4eca Merge pull request #567 from twpayne/no-events-in-renderers
No events in renderers
2013-04-20 02:52:32 -07:00
Tom Payne
fb0f1fb209 Cache array length in layer renderer 2013-04-20 11:34:48 +02:00
Tom Payne
879d9758c0 Cache array length in WebGL renderer 2013-04-20 11:34:48 +02:00
Tom Payne
72a83b99b7 Cache array length in DOM renderer 2013-04-20 11:34:48 +02:00
Tom Payne
68440e7e0f Cache array length in canvas renderer 2013-04-20 11:34:39 +02:00
Tom Payne
7979726327 Avoid creating an ol.Size object 2013-04-19 20:52:40 +02:00
Tom Payne
d964bbc605 Use for loop instead of forEach in WebGL tile layer renderer 2013-04-19 20:41:54 +02:00
Tom Payne
f5611d6cd6 Use for loop instead of forEach in WebGL map renderer 2013-04-19 20:29:24 +02:00
Tom Payne
388e530420 Use for loop instead of forEach in DOM map renderer 2013-04-19 20:22:20 +02:00
Tom Payne
fe5c8a97d4 Add ol.renderer.Map#getLayerRendererByKey 2013-04-19 20:22:01 +02:00
Tom Payne
37d3f7b4c1 Use for loop instead of forEach in canvas map renderer 2013-04-19 20:12:11 +02:00
Tom Payne
305089d84f Port ol.renderer.webgl to new extents 2013-04-19 10:03:35 +02:00
Tom Payne
10d1be695d Port ol.renderer.dom to new extents 2013-04-19 10:03:35 +02:00
Tom Payne
465e24cf4e Port ol.renderer.canvas to new extents 2013-04-19 10:03:35 +02:00
Tom Payne
8831d25929 Remove DOM layer in render, not in dispose 2013-04-18 19:25:49 +02:00
Tom Payne
f7c0c26bed Update layer visibility in DOM renderer 2013-04-18 19:21:06 +02:00
Tom Payne
d291d23092 ol.renderer.Layer no longer needs to inherit from ol.Object 2013-04-18 18:59:22 +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
f274cc99f6 Don't call event handlers in constructor 2013-04-18 16:35:06 +02:00
Tom Payne
87358296f4 Merge pull request #564 from twpayne/frame-index
Frame index
2013-04-18 06:16:30 -07:00
Tom Payne
bc9f702d84 Merge pull request #563 from twpayne/single-image-load-render
Render instead of requestRenderFrame when single image loads
2013-04-18 06:05:44 -07:00