From cc8f3d2319b27bdc1948cf0a926f25231e5ec1a2 Mon Sep 17 00:00:00 2001 From: crschmidt Date: Fri, 21 Mar 2008 15:45:54 +0000 Subject: [PATCH] Use the more modern click handler to interact with click events rather thanregistering directly on the map. This gives more flexibility and functionalityto applications, and should be the preferred way to handle these events goingforward. git-svn-id: http://svn.openlayers.org/trunk/openlayers@6571 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- examples/click.html | 47 ++++++++++++++++++++++++++++++++++++++------- 1 file changed, 40 insertions(+), 7 deletions(-) diff --git a/examples/click.html b/examples/click.html index 884a7d1da5..1c19414994 100644 --- a/examples/click.html +++ b/examples/click.html @@ -12,6 +12,36 @@ @@ -44,11 +74,14 @@

- This example shows the use of the register and getLonLatFromViewPortPx functions to trigger events on mouse click. + This example shows the use of the click handler and getLonLatFromViewPortPx functions to trigger events on mouse click. +

-
+
+ Using the Click handler allows you to (for example) catch clicks without catching double clicks, something that standard browser events don't do for you. (Try double clicking: you'll zoom in, whereas using the browser click event, you would just get two alerts.) This example click control shows you how to use it. +