With a confirmation that Tim is happy considering this a review, I'm going to

go ahead and commit this (relatively lighttweight) patch to the code so that
the projection library base API is there, even though for the most part, it's
not usable yet. This changes map.projection from being a string to being a 
class, with a projCode on it. (Closes #1035)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@5401 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2007-12-13 23:29:18 +00:00
parent c3c2895e8c
commit abe2a52c31
8 changed files with 46 additions and 12 deletions

View File

@@ -1405,11 +1405,30 @@ OpenLayers.Map = OpenLayers.Class({
/**
* APIMethod: getProjection
* This method returns a string representing the projection. In
* the case of projection support, this will be the srsCode which
* is loaded -- otherwise it will simply be the string value that
* was passed to the projection at startup.
*
* FIXME: In 3.0, we will remove getProjectionObject, and instead
* return a Projection object from this function.
*
* Returns:
* {String} The Projection of the base layer.
* {String} The Projection string from the base layer or null.
*/
getProjection: function() {
var projection = this.getProjectionObject();
return projection ? projection.getCode() : null;
},
/**
* APIMethod: getProjectionObject
* Returns the projection obect from the baselayer.
*
* Returns:
* {<OpenLayers.Projection>} The Projection of the base layer.
*/
getProjectionObject: function() {
var projection = null;
if (this.baseLayer != null) {
projection = this.baseLayer.projection;