Fix #7460: use the matrixSet projection by default

This commit is contained in:
oterral
2017-11-09 15:09:33 +01:00
parent a73170ca1d
commit 5a252e628b
3 changed files with 41 additions and 8 deletions

View File

@@ -93,8 +93,9 @@ ol.tilegrid.WMTS.createFromCapabilitiesMatrixSet = function(matrixSet, opt_exten
var tileHeightPropName = 'TileHeight';
var projection;
projection = ol.proj.get(matrixSet[supportedCRSPropName].replace(
/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/, '$1:$3'));
var code = matrixSet[supportedCRSPropName];
projection = ol.proj.get(code.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/, '$1:$3')) ||
ol.proj.get(code);
var metersPerUnit = projection.getMetersPerUnit();
// swap origin x and y coordinates if axis orientation is lat/long
var switchOriginXY = projection.getAxisOrientation().substr(0, 2) == 'ne';