Correctly reproject projections with undefined units
This commit is contained in:
@@ -36,20 +36,19 @@ ol.reproj.Image = function(sourceProj, targetProj,
|
||||
var limitedTargetExtent = ol.extent.getIntersection(
|
||||
targetExtent, maxTargetExtent);
|
||||
|
||||
var targetCenter = ol.extent.getCenter(limitedTargetExtent);
|
||||
var sourceResolution = ol.reproj.calculateSourceResolution(
|
||||
sourceProj, targetProj, targetCenter, targetResolution);
|
||||
|
||||
var errorThresholdInPixels = ol.DEFAULT_RASTER_REPROJ_ERROR_THRESHOLD;
|
||||
|
||||
// in source units
|
||||
var errorThreshold = targetResolution * errorThresholdInPixels *
|
||||
targetProj.getMetersPerUnit() / sourceProj.getMetersPerUnit();
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {!ol.reproj.Triangulation}
|
||||
*/
|
||||
this.triangulation_ = new ol.reproj.Triangulation(
|
||||
sourceProj, targetProj, limitedTargetExtent, this.maxSourceExtent_,
|
||||
errorThreshold);
|
||||
sourceResolution * errorThresholdInPixels);
|
||||
|
||||
/**
|
||||
* @private
|
||||
@@ -65,10 +64,6 @@ ol.reproj.Image = function(sourceProj, targetProj,
|
||||
|
||||
var srcExtent = this.triangulation_.calculateSourceExtent();
|
||||
|
||||
var targetCenter = ol.extent.getCenter(targetExtent);
|
||||
var sourceResolution = ol.reproj.calculateSourceResolution(
|
||||
sourceProj, targetProj, targetCenter, targetResolution);
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {ol.ImageBase}
|
||||
|
||||
Reference in New Issue
Block a user