From 32f70d06c297f55f8077bf0c753cbf6083a99b81 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Thu, 7 Apr 2011 19:15:45 +0000 Subject: [PATCH] Mobilize the canvas hit detection exmample. git-svn-id: http://svn.openlayers.org/trunk/openlayers@11887 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- examples/canvas-hit-detection.html | 9 ++++++++- examples/canvas-hit-detection.js | 4 ++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/examples/canvas-hit-detection.html b/examples/canvas-hit-detection.html index fc4bda69a7..1b9600f091 100644 --- a/examples/canvas-hit-detection.html +++ b/examples/canvas-hit-detection.html @@ -2,8 +2,10 @@ OpenLayers Canvas Hit Detection Example + + + - @@ -14,6 +16,11 @@

Feature Hit Detection with Canvas

+

+ Click on the features above to see them selected. This example + uses the Canvas renderer so it only works on browsers where + canvas is supported. +

View the canvas-hit-detection.js source to see how this is done. diff --git a/examples/canvas-hit-detection.js b/examples/canvas-hit-detection.js index b45562eab0..abc6897381 100644 --- a/examples/canvas-hit-detection.js +++ b/examples/canvas-hit-detection.js @@ -25,7 +25,7 @@ var Rule = OpenLayers.Rule; var Filter = OpenLayers.Filter; var style = new OpenLayers.Style({ pointRadius: 10, - strokeWidth: 2, + strokeWidth: 3, strokeOpacity: 0.7, strokeColor: "navy", fillColor: "#ffcc66", @@ -83,6 +83,6 @@ var map = new OpenLayers.Map({ zoom: 0 }); -var select = new OpenLayers.Control.SelectFeature(layer, {hover: true}); +var select = new OpenLayers.Control.SelectFeature(layer); map.addControl(select); select.activate();