add displayProjection API Property on the Map, and on relevant controls.
Spherical mercator example now makes use of this, displaying coordinates in lon/lat instead of meters, and permalink/argparser now work in lon/lat as well. this functionality will make using SphericalMercator easier for a number of applications. r=tschaub (Closes #1036) git-svn-id: http://svn.openlayers.org/trunk/openlayers@5519 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -51,6 +51,13 @@ OpenLayers.Control.MousePosition = OpenLayers.Class(OpenLayers.Control, {
|
||||
* {<OpenLayers.LonLat>}
|
||||
*/
|
||||
lastXy: null,
|
||||
|
||||
/**
|
||||
* APIProperty: displayProjection
|
||||
* {<OpenLayers.Projection>} A projection that the
|
||||
* mousecontrol will display.
|
||||
*/
|
||||
displayProjection: null,
|
||||
|
||||
/**
|
||||
* Constructor: OpenLayers.Control.MousePosition
|
||||
@@ -113,7 +120,12 @@ OpenLayers.Control.MousePosition = OpenLayers.Class(OpenLayers.Control, {
|
||||
// map has not yet been properly initialized
|
||||
return;
|
||||
}
|
||||
if (this.displayProjection) {
|
||||
lonLat.transform(this.map.getProjectionObject(),
|
||||
this.displayProjection );
|
||||
}
|
||||
this.lastXy = evt.xy;
|
||||
|
||||
}
|
||||
|
||||
var digits = parseInt(this.numdigits);
|
||||
|
||||
Reference in New Issue
Block a user