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:
crschmidt
2007-12-19 23:36:34 +00:00
parent 811e35cff3
commit acc8cfc0f2
6 changed files with 117 additions and 14 deletions
+16
View File
@@ -238,6 +238,15 @@ OpenLayers.Map = OpenLayers.Class({
* stylesheets or style declarations directly in your page.
*/
theme: null,
/**
* APIProperty: displayProjection
* {<OpenLayers.Projection>} Requires proj4js support.Projection used by
* several controls to display data to user. If this property is set,
* it will be set on any control which has a null displayProjection
* property at the time the control is added to the map.
*/
displayProjection: null,
/**
* APIProperty: fallThrough
@@ -915,6 +924,13 @@ OpenLayers.Map = OpenLayers.Class({
// If a control doesn't have a div at this point, it belongs in the
// viewport.
control.outsideViewport = (control.div != null);
// If the map has a displayProjection, and the control doesn't, set
// the display projection.
if (this.displayProjection && !control.displayProjection) {
control.displayProjection = this.displayProjection;
}
control.setMap(this);
var div = control.draw(px);
if (div) {