From 68f70f750b8024e93063c54313af794496d585ac Mon Sep 17 00:00:00 2001 From: crschmidt Date: Tue, 26 Aug 2008 14:22:59 +0000 Subject: [PATCH] Add support for a Canvas renderer. This renderer will allow for some new capabilties in OpenLayers Vector drawing, including: * Vector support for iPhone, Safari 2.x series browsers * Improved performance of dragging the map with a large number of geometries. The Vector layer default renderer order is now SVG, VML, Canvas, so browsers with Canvas support and no SVG or VML will be able to draw vectors. The Canvas layer has a number of limitations: getFeatureFromEvent is much slower than the other types of layer, and any change to any feature requires a redraw of the entire canvas. Because Canvas is typically a pretty fast drawing implementation, the latter is less problematic than it might otherwise be. r=pagameba,fred, with glances from a couple other people. (Closes #1512) git-svn-id: http://svn.openlayers.org/trunk/openlayers@7862 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- examples/wfs-reprojection.html | 34 ++- lib/OpenLayers.js | 1 + lib/OpenLayers/Layer/Vector.js | 26 +- lib/OpenLayers/Renderer.js | 11 + lib/OpenLayers/Renderer/Canvas.js | 425 ++++++++++++++++++++++++++++++ tests/Renderer/Canvas.html | 86 ++++++ tests/list-tests.html | 1 + 7 files changed, 576 insertions(+), 8 deletions(-) create mode 100644 lib/OpenLayers/Renderer/Canvas.js create mode 100644 tests/Renderer/Canvas.html diff --git a/examples/wfs-reprojection.html b/examples/wfs-reprojection.html index 9cebc30424..91efcb8ba7 100644 --- a/examples/wfs-reprojection.html +++ b/examples/wfs-reprojection.html @@ -1,13 +1,14 @@ + WFS Reprojection + Canvas Renderer Example + + + +
+ + diff --git a/tests/list-tests.html b/tests/list-tests.html index 3617f2536a..9c68c3dbe0 100644 --- a/tests/list-tests.html +++ b/tests/list-tests.html @@ -114,6 +114,7 @@
  • Projection.html
  • Protocol.html
  • Renderer.html
  • +
  • Renderer/Canvas.html
  • Renderer/Elements.html
  • Renderer/SVG.html
  • Renderer/VML.html