Other option

Example via XYZ tiles connection

file:///C:/Users/USER/Desktop/OfflineMaps/Cyprus/{z}/{x}/{y}.png

Example with code

url = 'type=xyz&url=file:///C:/Users/USER/Desktop/OfflineMaps/Cyprus/%7Bz%7D/%7Bx%7D/%7By%7D.png&zmax=10&zmin=0'
layer = QgsRasterLayer(url, "CyprusOffline_python", 'wms')
QgsProject.instance().addMapLayer(layer)
Advertisements

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: