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
This commit is contained in:
32
Control.MousePosition.txt
Normal file
32
Control.MousePosition.txt
Normal file
@@ -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: '<br />')
|
||||
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 = '<br />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.)
|
||||
|
||||
@@ -10,6 +10,7 @@ Patch contributors
|
||||
------------------
|
||||
Corey Puffault
|
||||
Tim Schaub
|
||||
Jeff Dege
|
||||
|
||||
OpenLayers is graciously supported by MetaCarta, Inc.
|
||||
<http://www.metacarta.com>.
|
||||
|
||||
Reference in New Issue
Block a user