Rename ol.Projection.createFromCode to getFromCode

This commit is contained in:
Tom Payne
2012-07-18 23:01:53 +02:00
parent da941562cc
commit 376d75ea4f
4 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -79,7 +79,7 @@ ol.createMap = function(target, opt_values, opt_rendererHints) {
if (!goog.object.containsKey(values, ol.MapProperty.PROJECTION)) { if (!goog.object.containsKey(values, ol.MapProperty.PROJECTION)) {
values[ol.MapProperty.PROJECTION] = values[ol.MapProperty.PROJECTION] =
ol.Projection.createFromCode(ol.DEFAULT_PROJECTION_CODE); ol.Projection.getFromCode(ol.DEFAULT_PROJECTION_CODE);
} }
/** /**
+3 -3
View File
@@ -162,7 +162,7 @@ ol.Projection.addTransform = function(source, destination, transform) {
* @param {string} code Code. * @param {string} code Code.
* @return {ol.Projection} Projection. * @return {ol.Projection} Projection.
*/ */
ol.Projection.createFromCode = function(code) { ol.Projection.getFromCode = function(code) {
var projections = ol.Projection.projections_; var projections = ol.Projection.projections_;
goog.asserts.assert(goog.object.containsKey(projections, code)); goog.asserts.assert(goog.object.containsKey(projections, code));
return projections[code]; return projections[code];
@@ -208,8 +208,8 @@ ol.Projection.getTransform = function(source, destination) {
* @return {ol.TransformFunction} Transform. * @return {ol.TransformFunction} Transform.
*/ */
ol.Projection.getTransformFromCodes = function(sourceCode, destinationCode) { ol.Projection.getTransformFromCodes = function(sourceCode, destinationCode) {
var source = ol.Projection.createFromCode(sourceCode); var source = ol.Projection.getFromCode(sourceCode);
var destination = ol.Projection.createFromCode(destinationCode); var destination = ol.Projection.getFromCode(destinationCode);
return ol.Projection.getTransform(source, destination); return ol.Projection.getTransform(source, destination);
}; };
+2 -2
View File
@@ -5,7 +5,7 @@ goog.require('ol.Projection');
function _testAllEquivalent(codes) { function _testAllEquivalent(codes) {
var projections = goog.array.map(codes, ol.Projection.createFromCode); var projections = goog.array.map(codes, ol.Projection.getFromCode);
goog.array.forEach(projections, function(source) { goog.array.forEach(projections, function(source) {
goog.array.forEach(projections, function(destination) { goog.array.forEach(projections, function(destination) {
assertTrue(ol.Projection.equivalent(source, destination)); assertTrue(ol.Projection.equivalent(source, destination));
@@ -34,7 +34,7 @@ function testEpsg4326Equivalence() {
function testIdentityTransform() { function testIdentityTransform() {
var epsg4326 = ol.Projection.createFromCode('EPSG:4326'); var epsg4326 = ol.Projection.getFromCode('EPSG:4326');
var uniqueObject = {}; var uniqueObject = {};
var sourcePoint = new goog.math.Coordinate(uniqueObject, uniqueObject); var sourcePoint = new goog.math.Coordinate(uniqueObject, uniqueObject);
var destinationPoint = ol.Projection.transform( var destinationPoint = ol.Projection.transform(
+1 -1
View File
@@ -14,7 +14,7 @@ goog.require('ol.tilegrid.createOpenStreetMap');
*/ */
ol.tilestore.createOpenStreetMap = function() { ol.tilestore.createOpenStreetMap = function() {
var projection = ol.Projection.createFromCode('EPSG:3857'); var projection = ol.Projection.getFromCode('EPSG:3857');
var tileGrid = ol.tilegrid.createOpenStreetMap(18); var tileGrid = ol.tilegrid.createOpenStreetMap(18);
var tileUrlFunction = ol.TileUrlFunction.withTileCoordTransform( var tileUrlFunction = ol.TileUrlFunction.withTileCoordTransform(
function(tileCoord) { function(tileCoord) {