Rename ol.projection.getFromCode to ol.projection.get

This commit is contained in:
Tom Payne
2013-03-06 18:02:46 +01:00
parent 6bcbd25e2f
commit afcbec469a
16 changed files with 50 additions and 50 deletions

View File

@@ -177,7 +177,7 @@ ol.control.ScaleLine.prototype.updateElement_ = function(frameState) {
// Convert pointResolution from meters or feet to degrees
if (goog.isNull(this.toEPSG4326_)) {
this.toEPSG4326_ = ol.projection.getTransform(
projection, ol.projection.getFromCode('EPSG:4326'));
projection, ol.projection.get('EPSG:4326'));
}
var vertex = [center.x, center.y];
vertex = this.toEPSG4326_(vertex, vertex, 2);

View File

@@ -77,7 +77,7 @@ ol.Geolocation.prototype.handleProjectionChanged_ = function() {
var projection = this.getProjection();
if (goog.isDefAndNotNull(projection)) {
this.transformFn_ = ol.projection.getTransform(
ol.projection.getFromCode('EPSG:4326'), projection);
ol.projection.get('EPSG:4326'), projection);
if (!goog.isNull(this.position_)) {
var vertex = [this.position_.x, this.position_.y];
vertex = this.transformFn_(vertex, vertex, 2);

View File

@@ -79,7 +79,7 @@ ol.parser.ogc.WMTSCapabilities_v1_0_0 = function() {
var topLeftCorner = this.getChildValue(node);
var coords = topLeftCorner.split(' ');
var axisOrientation =
ol.projection.getFromCode(obj['supportedCRS']).getAxisOrientation();
ol.projection.get(obj['supportedCRS']).getAxisOrientation();
obj['topLeftCorner'] = ol.Coordinate.fromProjectedArray(
[parseFloat(coords[0]), parseFloat(coords[1])], axisOrientation);
},

View File

@@ -13,7 +13,7 @@
@exportProperty ol.ProjectionUnits.METERS
@exportSymbol ol.projection.addProjection
@exportSymbol ol.projection.getFromCode
@exportSymbol ol.projection.get
@exportSymbol ol.projection.getTransform
@exportSymbol ol.projection.getTransformFromCodes
@exportSymbol ol.projection.transform

View File

@@ -365,9 +365,9 @@ ol.projection.clearAllProjections = function() {
*/
ol.projection.createProjection = function(projection, defaultCode) {
if (!goog.isDefAndNotNull(projection)) {
return ol.projection.getFromCode(defaultCode);
return ol.projection.get(defaultCode);
} else if (goog.isString(projection)) {
return ol.projection.getFromCode(projection);
return ol.projection.get(projection);
} else {
goog.asserts.assert(projection instanceof ol.Projection);
return projection;
@@ -426,7 +426,7 @@ ol.projection.removeTransform = function(source, destination) {
* such as “EPSG:4326”.
* @return {ol.Projection} Projection.
*/
ol.projection.getFromCode = function(code) {
ol.projection.get = function(code) {
var projection = ol.projection.projections_[code];
if (ol.HAVE_PROJ4JS && !goog.isDef(projection)) {
projection = ol.projection.getProj4jsProjectionFromCode_({
@@ -579,8 +579,8 @@ ol.projection.getTransform = function(source, destination) {
* @return {ol.TransformFunction} Transform.
*/
ol.projection.getTransformFromCodes = function(sourceCode, destinationCode) {
var source = ol.projection.getFromCode(sourceCode);
var destination = ol.projection.getFromCode(destinationCode);
var source = ol.projection.get(sourceCode);
var destination = ol.projection.get(destinationCode);
return ol.projection.getTransform(source, destination);
};

View File

@@ -24,7 +24,7 @@ ol.source.BingMaps = function(bingMapsOptions) {
goog.base(this, {
opaque: true,
projection: ol.projection.getFromCode('EPSG:3857')
projection: ol.projection.get('EPSG:3857')
});
/**
@@ -112,7 +112,7 @@ ol.source.BingMaps.prototype.handleImageryMetadataResponse =
})));
var transform = ol.projection.getTransform(
ol.projection.getFromCode('EPSG:4326'), this.getProjection());
ol.projection.get('EPSG:4326'), this.getProjection());
var attributions = goog.array.map(
resource.imageryProviders,
function(imageryProvider) {

View File

@@ -52,7 +52,7 @@ goog.exportSymbol('grid', grid);
ol.source.TileJSON = function(tileJsonOptions) {
goog.base(this, {
projection: ol.projection.getFromCode('EPSG:3857')
projection: ol.projection.get('EPSG:3857')
});
/**
@@ -80,7 +80,7 @@ ol.source.TileJSON.prototype.handleTileJSONResponse = function() {
var tileJSON = ol.tilejson.grids_.pop();
var epsg4326Projection = ol.projection.getFromCode('EPSG:4326');
var epsg4326Projection = ol.projection.get('EPSG:4326');
var epsg4326Extent, extent;
if (goog.isDef(tileJSON.bounds)) {

View File

@@ -37,7 +37,7 @@ ol.source.XYZOptions;
ol.source.XYZ = function(xyzOptions) {
var projection = xyzOptions.projection ||
ol.projection.getFromCode('EPSG:3857');
ol.projection.get('EPSG:3857');
/**
* @type {ol.TileUrlFunctionType}