-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
ol.layer.Tile 'drawImage' on 'CanvasRenderingContext2D' exception when zoom out #8700
Comments
Confirmed. This happens when the tile gets downscaled to a width or height of 0 pixels. A fix would be to only call drawImage when |
Sorry, I don’t have any experience with the ol codebase beyond using it, so fixing it would be a bit beyond me. For anyone finding this bug in the future: My temporary fix is to set the maxResolution of the layer to the same as the shortest size (in meters) of the tile set extent. My logic being that if resolution is defined in meters per pixel then this will be the resolution where the rendered image becomes <=1px wide and is of no use showing anyway.
|
I had the same error but it was related to the ol.style.Style and how I assigned the svg image to it. The error was introduced when I updated my npm package from 'npm i openlayers' to 'npm i ol'. Broken: Original code
FIX: The solution was to base64 the svg image before adding it to the ol.style.Style object.
|
If I add a XYZ Image Tile layer with a small extent and then zoom out a long way I get fatal JS errors which cause the map to stop responding to interactions.
Example
https://jsfiddle.net/chris_h/scom9yv5/10/ (zoom out to < level 6 in Chrome or Firefox)
In the example I am mis-using a static image as a tile source however in my real code I have a proper tile set and still experience the same issues.
Chrome 69:
Firefox 61
Edge
The line of failing code is:
The text was updated successfully, but these errors were encountered: