Skip to content

Commit

Permalink
Add new baselayers, based on previous checkbox
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustry committed Nov 23, 2023
1 parent 1efc2be commit f7c63b4
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
13 changes: 13 additions & 0 deletions lizmap/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,11 @@ def write_log_message(message, tag, level):
self.dlg.add_group_empty.clicked.connect(self.add_group_empty)
self.dlg.add_group_overview.clicked.connect(self.add_group_overview)

osm_icon = QIcon(resources_path('icons', 'osm-32-32.png'))
self.dlg.button_osm_mapnik.clicked.connect(self.add_osm_mapnik)
self.dlg.button_osm_mapnik.setIcon(osm_icon)
self.dlg.button_osm_opentopomap.clicked.connect(self.add_osm_opentopomap)
self.dlg.button_osm_opentopomap.setIcon(osm_icon)
self.dlg.button_ign_orthophoto.clicked.connect(
partial(self.add_french_ign_layer, IgnLayers.IgnOrthophoto))
self.dlg.button_ign_plan.clicked.connect(
Expand Down Expand Up @@ -2520,6 +2524,15 @@ def add_osm_mapnik(self):
'https://openstreetmap.org',
'© ' + tr('OpenStreetMap contributors'))

def add_osm_opentopomap(self):
""" Add the OSM OpenTopoMap base layer. """
source = 'type=xyz&zmin=0&zmax=18&url=https://tile.opentopomap.org/{z}/{x}/{y}.png'
self._add_base_layer(
source,
'OpenTopoMap',
'https://openstreetmap.org',
'© ' + tr('OpenStreetMap contributors') + ', SRTM, © OpenTopoMap (CC-BY-SA)')

def add_french_ign_layer(self, layer: IgnLayer):
""" Add some French IGN layers. """
params = {
Expand Down
15 changes: 13 additions & 2 deletions lizmap/resources/ui/ui_lizmap.ui
Original file line number Diff line number Diff line change
Expand Up @@ -2693,14 +2693,25 @@ This is different to the map maximum extent (defined in QGIS project properties,
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_34">
<layout class="QHBoxLayout" name="horizontalLayout_51">
<item>
<widget class="QPushButton" name="button_osm_mapnik">
<property name="text">
<string>OpenStreetMap Mapnik</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="button_osm_opentopomap">
<property name="text">
<string notr="true">OpenTopoMap</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_34">
<item>
<widget class="QPushButton" name="button_ign_orthophoto">
<property name="text">
Expand All @@ -2718,7 +2729,7 @@ This is different to the map maximum extent (defined in QGIS project properties,
<item>
<widget class="QPushButton" name="button_ign_cadastre">
<property name="text">
<string>IGN Parcellaire</string>
<string notr="true">IGN Parcellaire</string>
</property>
</widget>
</item>
Expand Down

0 comments on commit f7c63b4

Please sign in to comment.