On a land I can zoom up to 20 points, but on the sea/ocean I can only zoom up to 7-12 point (it depends which location you are zooming). If I zoom above 7-12 point on the ocean I see 404 errors in browser console (https://khms0.googleapis.com/kh?v=944&hl=en-GB&x=260660&y=177418&z=19) and when I reach 19 map becomes gray.
Is there a way to limit max zoom value depending on the coordinates you are standing and get rid of console errors?
You could use MaxZoomService
available in the api to get the max zoom level api available in a certain area.
This way you can follow this algorithm: