-
Notifications
You must be signed in to change notification settings - Fork 410
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #1304 Implemented WMTS on OpenLayers #1341
Conversation
@@ -102,6 +102,25 @@ | |||
} | |||
}, | |||
{ | |||
"type": "wmts", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this layer from default configuration
create: (options) => { | ||
const urls = getWMSURLs(isArray(options.url) ? options.url : [options.url]); | ||
const queryParameters = wmtsToOpenlayersOptions(options) || {}; | ||
var projection = ol.proj.get('EPSG:900913'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should use the srs in options, not a fixed 900913
matrixSet: options.tileMatrixSet, | ||
format: 'image/png', | ||
tileGrid: new ol.tilegrid.WMTS({ | ||
origin: ol.extent.getTopLeft(projectionExtent), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should consider using originX and originY options as we do for leaflet
…into wmts_openlayers
…into wmts_openlayers
let matrixIds = new Array(22); | ||
for (let z = 0; z < 22; ++z) { | ||
// generate matrixIds arrays for this WMTS | ||
matrixIds[z] = options.tileMatrixPrefix + z; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should have a list of matrixIds as a configuration option. In the future it have to be populated checking the catalog. If the list is not present in configuration, this autogeneration method can be the solution.
const urls = getWMSURLs(isArray(options.url) ? options.url : [options.url]); | ||
const queryParameters = wmtsToOpenlayersOptions(options) || {}; | ||
urls.forEach(url => SecurityUtils.addAuthenticationParameter(url, queryParameters)); | ||
let matrixIds = new Array(22); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tile matrix zoom levels are not 22 everywhere. Even when auto-generation is used, the list of resolutions and matrixIds can be variable. In general we should follow the information from WMTS.
Keep in mind these 2 examples:
- http://basemap.nationalmap.gov/arcgis/rest/services/USGSHydroNHD/MapServer/WMTS/1.0.0/WMTSCapabilities.xml
- http://basemap.nationalmap.gov/arcgis/rest/services/USGSHydroNHD/MapServer/WMTS/1.0.0/WMTSCapabilities.xml
As you see the identifier and the list are not the same.
Replaced by #1397 |
#1304 Implemented support for WMTS on OpenLayers.