Introduce tile-pixels units
This commit is contained in:
@@ -2,10 +2,12 @@ goog.provide('ol.geom.Geometry');
|
||||
goog.provide('ol.geom.GeometryLayout');
|
||||
goog.provide('ol.geom.GeometryType');
|
||||
|
||||
goog.require('goog.asserts');
|
||||
goog.require('goog.functions');
|
||||
goog.require('ol.Object');
|
||||
goog.require('ol.extent');
|
||||
goog.require('ol.proj');
|
||||
goog.require('ol.proj.Units');
|
||||
|
||||
|
||||
/**
|
||||
@@ -250,6 +252,9 @@ ol.geom.Geometry.prototype.translate = goog.abstractMethod;
|
||||
* @api stable
|
||||
*/
|
||||
ol.geom.Geometry.prototype.transform = function(source, destination) {
|
||||
goog.asserts.assert(
|
||||
ol.proj.get(source).getUnits() !== ol.proj.Units.TILE_PIXELS,
|
||||
'cannot transform geometries with TILE_PIXELS units');
|
||||
this.applyTransform(ol.proj.getTransform(source, destination));
|
||||
return this;
|
||||
};
|
||||
|
||||
@@ -23,7 +23,8 @@ ol.proj.ProjectionLike;
|
||||
|
||||
|
||||
/**
|
||||
* Projection units: `'degrees'`, `'ft'`, `'m'`, `'pixels'`, or `'us-ft'`.
|
||||
* Projection units: `'degrees'`, `'ft'`, `'m'`, `'pixels'`, `'tile-pixels'` or
|
||||
* `'us-ft'`.
|
||||
* @enum {string}
|
||||
* @api stable
|
||||
*/
|
||||
@@ -32,6 +33,7 @@ ol.proj.Units = {
|
||||
FEET: 'ft',
|
||||
METERS: 'm',
|
||||
PIXELS: 'pixels',
|
||||
TILE_PIXELS: 'tile-pixels',
|
||||
USFEET: 'us-ft'
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user