Merge pull request #2322 from ahocevar/view-projection
Make sure that projection is an ol.proj.Projection instance
This commit is contained in:
@@ -699,8 +699,8 @@ ol.View.createResolutionConstraint_ = function(options) {
|
|||||||
resolutions);
|
resolutions);
|
||||||
} else {
|
} else {
|
||||||
// calculate the default min and max resolution
|
// calculate the default min and max resolution
|
||||||
var projection = options.projection;
|
var projection = ol.proj.createProjection(options.projection, 'EPSG:3857');
|
||||||
var extent = ol.proj.createProjection(projection, 'EPSG:3857').getExtent();
|
var extent = projection.getExtent();
|
||||||
var size = goog.isNull(extent) ?
|
var size = goog.isNull(extent) ?
|
||||||
// use an extent that can fit the whole world if need be
|
// use an extent that can fit the whole world if need be
|
||||||
360 * ol.proj.METERS_PER_UNIT[ol.proj.Units.DEGREES] /
|
360 * ol.proj.METERS_PER_UNIT[ol.proj.Units.DEGREES] /
|
||||||
|
|||||||
Reference in New Issue
Block a user