Vérif présence layer OpenStreetMap
This commit is contained in:
parent
85dc227d35
commit
6a59dec2c3
@ -172,7 +172,7 @@ class Orientation:
|
||||
icon_path = ':/plugins/caliec/icon.png'
|
||||
self.add_action(
|
||||
icon_path,
|
||||
text=self.tr(u'Créer le projet'),
|
||||
text=self.tr('Créer le projet'),
|
||||
callback=self.run,
|
||||
parent=self.iface.mainWindow())
|
||||
|
||||
@ -184,7 +184,7 @@ class Orientation:
|
||||
"""Removes the plugin menu item and icon from QGIS GUI."""
|
||||
for action in self.actions:
|
||||
self.iface.removePluginMenu(
|
||||
self.tr(u'&CaLiÉc'),
|
||||
self.tr('CaLiÉc'),
|
||||
action)
|
||||
self.iface.removeToolBarIcon(action)
|
||||
|
||||
@ -201,7 +201,6 @@ class Orientation:
|
||||
tempdir = tempfile.TemporaryDirectory()
|
||||
styles_url = 'https://forge.chapril.org/linux_alpes/caliec/raw/branch/master/styles/'
|
||||
lambert93 = QgsCoordinateReferenceSystem("EPSG:2154")
|
||||
wgs = QgsCoordinateReferenceSystem("EPSG:4326")
|
||||
wgspm = QgsCoordinateReferenceSystem("EPSG:3857")
|
||||
scr = wgspm
|
||||
project = QgsProject.instance()
|
||||
@ -212,6 +211,10 @@ class Orientation:
|
||||
context = dataobjects.createContext()
|
||||
context.setInvalidGeometryCheck(QgsFeatureRequest.GeometryNoCheck)
|
||||
|
||||
if len(project.mapLayersByName("OpenStreetMap")) == 0:
|
||||
QMessageBox.warning(self.iface.mainWindow(), "Attention", "Affichez d'abord un fond Openstreetmap (menu XYZ tiles) et cadrez la zone voulue")
|
||||
return
|
||||
|
||||
# Correspondances des noms des couches et des styles:
|
||||
# "NOM_DE_LA_COUCHE_OSM": ("nom_du_style", "nom_du_layer")
|
||||
# Commenter les couches non désirées
|
||||
|
Loading…
Reference in New Issue
Block a user