I'm using OpenLayers 6.13 in an iOS app. The app also runs on macOS (Mac Catalyst). The OpenLayers component runs in a WKWebView (essentially a Safari-esque web browser view, embedded in the app).
When running on the Mac if I increase the size of the window, the vector layers disappear and the javascript console reports the error:
Canvas area exceeds the maximum limit (width * height > 16777216).
If I decrease the window size again, the layers re-appear on the map.
(The WMTS layers never disappear, even when the window is larger.)
What's very odd about this, is that I can get the same layers to run in a very similar actual web site in actual Safari in the same map in a much larger browser window. The problem only seems to exist in my WKWebView.
How can this error be avoided in larger windows with OpenLayers?