Closed velle closed 1 year ago
The current version https://github.com/OSGeo/gdal/blob/master/swig/python/gdal-utils/osgeo_utils/gdal2tiles.py is using
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@main/dist/en/v7.0.0/legacy/ol.css" type="text/css">
<script src="https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@main/dist/en/v7.0.0/legacy/ol.js"></script>
The OpenLayers client that GDAL 3.7.1 creates works for me. GDAL project supports only the newest version so backport to 3.4.1 is not expected. Updating GDAL is the preferred action but your own fix is also good. Alternatively you can get the new gdal2tiles.py from the link above and try if it works well with your GDAL 3.4.1. That is not at all impossible.
Expected behavior and actual behavior.
gdal2tiles.py creates a folder with tiles, and with a few different webviewers (LeafLet, Google Maps and OpenLayers). The resulting openlayers.html does not work; instead giving various javascript errors.
Steps to reproduce the problem.
Here is what I tried:
Run on any tif:
Go to tilefolder and open openlayers.html in browser (I used Chromium)
Dead link issue
First of all it seems like it tries to import OpenLayers from dead links.
Those links give HTTP 403, with the following error message:
The github link suggested in the error message requires authentication. I tried with more recent versions of OpenLayers, like 8.0.0, but that caused other JavaScript errors.
Workaround, use version 6.5.0:
System
Ubuntu 22.04.3 64 bit GDAL 3.4.1, released 2021/12/27 (installed via apt) Chromium Version 116.0.5845.110 (Official Build) snap (64-bit)