Introduce tile-pixels units

This commit is contained in:
Andreas Hocevar
2015-10-13 14:15:30 +02:00
parent 05dfc226b7
commit 8f4756c99b
2 changed files with 8 additions and 1 deletions
+5
View File
@@ -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;
};