From 4f22f0738af9bfaa7d9186feb11efd061686db4b Mon Sep 17 00:00:00 2001 From: crschmidt Date: Fri, 6 Oct 2006 19:20:23 +0000 Subject: [PATCH] Jeff Dege contributed a MousePosition Control, which this commit adds to trunk. Reviewed by Erik on Trac and in person. git-svn-id: http://svn.openlayers.org/trunk/openlayers/doc@1665 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- Control.MousePosition.txt | 32 ++++++++++++++++++++++++++++++++ authors.txt | 1 + 2 files changed, 33 insertions(+) create mode 100644 Control.MousePosition.txt diff --git a/Control.MousePosition.txt b/Control.MousePosition.txt new file mode 100644 index 0000000000..9b3e8564ec --- /dev/null +++ b/Control.MousePosition.txt @@ -0,0 +1,32 @@ +OpenLayers.Control.MousePosition + +A small control which displays the Longitude and Latitude of the current mouse position, by defualt in the lower right of the map viewport. + +* Constructor + OpenLayers.Control.MousePosition({Object|options}) -- Creates a new MousePosition control. + + +* Parameters + + element -- if not null, div in which to display the MousePosition + prefix -- html to precede the longitude value (default: '') + separator -- html to separate the longitude and latitude values (default: '
') + suffix -- html to follow the latitude value (default: '') + numdigits -- number of digits to the right of the decimal (default: 5) + granularity -- a change of how many pixels is considered a mouse move (default: 1) + +prefix, separator, and suffix are used to format the lon/lat values. + +With: + prefix = 'Lon: ' + suffix = '
Lat: ' + suffix = '' + nudigits = 3 +Lon/Lat is displayed as: + Lon: 95.123 + Lat: 35.456 + +If the mouse has never been over the map, Lon/Lat will equal 0/0. If the mouse is over the map, Lon/Lat will equal the current mouse position. If the mouse has been moved off the map, Lon/Lat will equal the value displayed at the time the mouse was moved off the map. + +If the mouse is moving slowly, the Lon/Lat will refresh continuously. If the mouse is moving rapidly, the refresh of Lon/Lat will be suspended until the mouse has slowed down or stopped. (Trying to update the Lon/Lat value while the mouse is in rapid movemement makes the movement of the mouse unacceptably jerky.) + diff --git a/authors.txt b/authors.txt index 51f630c770..fbcd848834 100644 --- a/authors.txt +++ b/authors.txt @@ -10,6 +10,7 @@ Patch contributors ------------------ Corey Puffault Tim Schaub +Jeff Dege OpenLayers is graciously supported by MetaCarta, Inc. .