From 2f7fad80df40f30b79917b3009a5fd484ec07742 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Thu, 13 Dec 2007 14:53:36 +0000 Subject: [PATCH] Handler.Point doesn't render points if no default resolution props in map object. Thanks fredj for the review. (closes #1205) git-svn-id: http://svn.openlayers.org/trunk/openlayers@5396 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Handler/Point.js | 9 +++- tests/manual/draw-feature.html | 73 +++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 tests/manual/draw-feature.html diff --git a/lib/OpenLayers/Handler/Point.js b/lib/OpenLayers/Handler/Point.js index f428a3a2b2..c31b587980 100644 --- a/lib/OpenLayers/Handler/Point.js +++ b/lib/OpenLayers/Handler/Point.js @@ -87,7 +87,14 @@ OpenLayers.Handler.Point = OpenLayers.Class(OpenLayers.Handler, { } // create temporary vector layer for rendering geometry sketch // TBD: this could be moved to initialize/destroy - setting visibility here - var options = {displayInLayerSwitcher: false}; + var options = { + displayInLayerSwitcher: false, + // indicate that the temp vector layer will never be out of range + // without this, resolution properties must be specified at the + // map-level for this temporary layer to init its resolutions + // correctly + calculateInRange: function() { return true; } + }; this.layer = new OpenLayers.Layer.Vector(this.CLASS_NAME, options); this.map.addLayer(this.layer); return true; diff --git a/tests/manual/draw-feature.html b/tests/manual/draw-feature.html new file mode 100644 index 0000000000..8872b631ed --- /dev/null +++ b/tests/manual/draw-feature.html @@ -0,0 +1,73 @@ + + + Draw Feature Acceptance Test + + + + + + +
+

Resolution properties set at the map level.

+

Points should draw as you draw lines. Click to start + drawing and double-click to draw the last point.

+
+ +
+

Resolution properties set at the layer level.

+

Points should draw as you draw lines. Click to start + drawing and double-click to draw the last point.

+ +