Named exports from ol/proj
This commit is contained in:
committed by
Andreas Hocevar
parent
fab77e8d37
commit
6f72ffe498
@@ -6,7 +6,7 @@ import _ol_Object_ from '../Object.js';
|
||||
import {createEmpty, getHeight, returnOrUpdate} from '../extent.js';
|
||||
import _ol_functions_ from '../functions.js';
|
||||
import _ol_geom_flat_transform_ from '../geom/flat/transform.js';
|
||||
import _ol_proj_ from '../proj.js';
|
||||
import {get as getProjection, getTransform} from '../proj.js';
|
||||
import _ol_proj_Units_ from '../proj/Units.js';
|
||||
import _ol_transform_ from '../transform.js';
|
||||
|
||||
@@ -255,7 +255,7 @@ _ol_geom_Geometry_.prototype.translate = function(deltaX, deltaY) {};
|
||||
*/
|
||||
_ol_geom_Geometry_.prototype.transform = function(source, destination) {
|
||||
var tmpTransform = this.tmpTransform_;
|
||||
source = _ol_proj_.get(source);
|
||||
source = getProjection(source);
|
||||
var transformFn = source.getUnits() == _ol_proj_Units_.TILE_PIXELS ?
|
||||
function(inCoordinates, outCoordinates, stride) {
|
||||
var pixelExtent = source.getExtent();
|
||||
@@ -267,9 +267,9 @@ _ol_geom_Geometry_.prototype.transform = function(source, destination) {
|
||||
0, 0);
|
||||
_ol_geom_flat_transform_.transform2D(inCoordinates, 0, inCoordinates.length, stride,
|
||||
tmpTransform, outCoordinates);
|
||||
return _ol_proj_.getTransform(source, destination)(inCoordinates, outCoordinates, stride);
|
||||
return getTransform(source, destination)(inCoordinates, outCoordinates, stride);
|
||||
} :
|
||||
_ol_proj_.getTransform(source, destination);
|
||||
getTransform(source, destination);
|
||||
this.applyTransform(transformFn);
|
||||
return this;
|
||||
};
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @module ol/geom/flat/geodesic
|
||||
*/
|
||||
import _ol_math_ from '../../math.js';
|
||||
import _ol_proj_ from '../../proj.js';
|
||||
import {get as getProjection, getTransform} from '../../proj.js';
|
||||
var _ol_geom_flat_geodesic_ = {};
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ _ol_geom_flat_geodesic_.line_ = function(interpolate, transform, squaredToleranc
|
||||
_ol_geom_flat_geodesic_.greatCircleArc = function(
|
||||
lon1, lat1, lon2, lat2, projection, squaredTolerance) {
|
||||
|
||||
var geoProjection = _ol_proj_.get('EPSG:4326');
|
||||
var geoProjection = getProjection('EPSG:4326');
|
||||
|
||||
var cosLat1 = Math.cos(_ol_math_.toRadians(lat1));
|
||||
var sinLat1 = Math.sin(_ol_math_.toRadians(lat1));
|
||||
@@ -123,7 +123,7 @@ _ol_geom_flat_geodesic_.greatCircleArc = function(
|
||||
Math.atan2(Math.sin(theta) * sinD * cosLat1,
|
||||
cosD - sinLat1 * Math.sin(lat));
|
||||
return [_ol_math_.toDegrees(lon), _ol_math_.toDegrees(lat)];
|
||||
}, _ol_proj_.getTransform(geoProjection, projection), squaredTolerance);
|
||||
}, getTransform(geoProjection, projection), squaredTolerance);
|
||||
};
|
||||
|
||||
|
||||
@@ -137,7 +137,7 @@ _ol_geom_flat_geodesic_.greatCircleArc = function(
|
||||
* @return {Array.<number>} Flat coordinates.
|
||||
*/
|
||||
_ol_geom_flat_geodesic_.meridian = function(lon, lat1, lat2, projection, squaredTolerance) {
|
||||
var epsg4326Projection = _ol_proj_.get('EPSG:4326');
|
||||
var epsg4326Projection = getProjection('EPSG:4326');
|
||||
return _ol_geom_flat_geodesic_.line_(
|
||||
/**
|
||||
* @param {number} frac Fraction.
|
||||
@@ -146,7 +146,7 @@ _ol_geom_flat_geodesic_.meridian = function(lon, lat1, lat2, projection, squared
|
||||
function(frac) {
|
||||
return [lon, lat1 + ((lat2 - lat1) * frac)];
|
||||
},
|
||||
_ol_proj_.getTransform(epsg4326Projection, projection), squaredTolerance);
|
||||
getTransform(epsg4326Projection, projection), squaredTolerance);
|
||||
};
|
||||
|
||||
|
||||
@@ -160,7 +160,7 @@ _ol_geom_flat_geodesic_.meridian = function(lon, lat1, lat2, projection, squared
|
||||
* @return {Array.<number>} Flat coordinates.
|
||||
*/
|
||||
_ol_geom_flat_geodesic_.parallel = function(lat, lon1, lon2, projection, squaredTolerance) {
|
||||
var epsg4326Projection = _ol_proj_.get('EPSG:4326');
|
||||
var epsg4326Projection = getProjection('EPSG:4326');
|
||||
return _ol_geom_flat_geodesic_.line_(
|
||||
/**
|
||||
* @param {number} frac Fraction.
|
||||
@@ -169,6 +169,6 @@ _ol_geom_flat_geodesic_.parallel = function(lat, lon1, lon2, projection, squared
|
||||
function(frac) {
|
||||
return [lon1 + ((lon2 - lon1) * frac), lat];
|
||||
},
|
||||
_ol_proj_.getTransform(epsg4326Projection, projection), squaredTolerance);
|
||||
getTransform(epsg4326Projection, projection), squaredTolerance);
|
||||
};
|
||||
export default _ol_geom_flat_geodesic_;
|
||||
|
||||
Reference in New Issue
Block a user