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: adds checks for missing properties #1104
base: master
Are you sure you want to change the base?
Conversation
const size = getWidth(projectionExtent) / 256; | ||
const resolutions = new Array(19); | ||
const matrixIds = new Array(19); | ||
for (let z = 0; z < 19; ++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.
for (let z = 0; z < 19; ++z) { | |
for (let z = 0; z < 19; z++) { |
You need to increment after the statements in the loop are made, don't you?
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.
I think in that particular case it does not really matter, both variants seem to work.
|
||
const projectionExtent = projection.getExtent(); | ||
const size = getWidth(projectionExtent) / 256; | ||
const resolutions = new Array(19); |
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.
You assume that always 19 Matrix levels are available in tile grid definition?
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.
I got this part from the OpenLayers Examples but you are right, the array could always be different!
}); | ||
}; | ||
|
||
if (layer.source.style) { |
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.
Minor: You could also write
const style = layer?.source?.style ?? 'default'
instead of the if
-else
block
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.
Yes that looks way more clean thank you!
Description
WMTS Layer with missing properties could not be displayed. Adds a check for missing properties.
Related issues or pull requests
Pull request type
Do you introduce a breaking change?