Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

I'm using the latest Openlayers with a COG (cloud-optimized-geotiff). It works fine when I set the map view to the bounds of the GeoTIFF while creating the layer, but if I try setting the view to something else (or not changing it after creating the layer), the OpenLayers map freezes with almost 100% CPU usage. Has anyone else had this problem?

Code here https://codesandbox.io/s/cog-forked-6w9sf?file=/main.js . With the view as-is (centred on the GeoTIFF), it freezes; with the view set to the View from the just-added GeoTIFF layer, it works fine. I need to display the GeoTIFF layer in the context of the larger base map, so I need to use a different view.

WebGL tile layers cannot be reprojected, so you will need to reproject the base layer https://codesandbox.io/s/cog-forked-tmswq?file=/main.js You can predefine the possible projections using proj4, or you could load them as in https://openlayers.org/en/latest/examples/reprojection-by-code.html when the GeoTIFF view promise resolves.

(answer courtesy of mike-000)

Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center . Community Nov 25, 2021 at 21:02

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question . Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers .