def __init__(self, canvas, pickMode = 'selection'):
     self.canvas = canvas
     QgsMapToolIdentify.__init__(self, canvas)
     self.setCursor(QCursor())
     if pickMode == 'all':
         self.selectionMode = self.TopDownStopAtFirst
     elif pickMode == 'selection':
         self.selectionMode = self.LayerSelection
     elif pickMode == 'active':
         self.selectionMode = self.ActiveLayer
 def __init__(self, canvas, layer):
     """ Constructor.
     """
     QgsMapToolIdentify.__init__(self, canvas)
     self.canvas = canvas
     self.layer = layer
     self.setCursor(Qt.CrossCursor)
    def __init__(self, iface, parent=None, layer=None):
        QgsMapToolIdentify.__init__(self, iface.mapCanvas())
        self.canvas = iface.mapCanvas()
        self.iface = iface
        self.layer = layer
        self.parent = parent

        self.cursor = QCursor(QPixmap(["16 16 3 1",
                                       "      c None",
                                       ".     c #FF0000",
                                       "+     c #FFFFFF",
                                       "                ",
                                       "       +.+      ",
                                       "      ++.++     ",
                                       "     +.....+    ",
                                       "    +.     .+   ",
                                       "   +.   .   .+  ",
                                       "  +.    .    .+ ",
                                       " ++.    .    .++",
                                       " ... ...+... ...",
                                       " ++.    .    .++",
                                       "  +.    .    .+ ",
                                       "   +.   .   .+  ",
                                       "   ++.     .+   ",
                                       "    ++.....+    ",
                                       "      ++.++     ",
                                       "       +.+      "]))
Esempio n. 4
0
 def __init__(self, canvas, dlg):
     global features
     QgsMapToolIdentify.__init__(self, canvas)
     self.canvas = canvas
     self.dlg = dlg
     self.select_id = None
     self.tool = QgsMapToolIdentify(self.canvas)
    def __init__(self, iface, action, plugin_dir, spinbox):
        self.canvas = iface.mapCanvas()
        self.iface = iface
        self.action = action
        self.icon_path = os.path.join(plugin_dir,"icons")
        self.spinbox = spinbox

        self.rubberBand = QgsRubberBand(self.canvas, QgsWkbTypes.GeometryType(3))
        self.rubberBand.setWidth(3)
        self.rubberBand.setStrokeColor(QColor(254,0,0))

        self.snap_mark = QgsVertexMarker(self.canvas)
        self.snap_mark.setColor(QColor(0, 0, 255))
        self.snap_mark.setPenWidth(2)
        self.snap_mark.setIconType(QgsVertexMarker.ICON_BOX)
        self.snap_mark.setIconSize(10)

        QgsMapToolIdentify.__init__(self, self.canvas)

        self.selectFeatureMode = True
        self.firstPointMode = False
        self.secondPointMode = False
        self.objectSizeMode = False

        self.firstPoint_locate = None
        self.linestring = None

        self.dist = self.spinbox.value()

        self.canvas.layersChanged.connect(self.setPolygonLayers)
Esempio n. 6
0
 def __init__(self, street_browser_dk, iface, esu_layer, toolbar, db,
              mapper):
     """
     Build on init of QgsMapToolIdentify class for custom RN functionality.
     :param street_browser_dk: Street Browser dialog
     :param iface: Qgis interface reference
     :param esu_layer: ESU Graphic layer
     :param toolbar: toolbar instance
     :param db: database connection
     :param mapper: Qdatawidgetmapper of street browser
     """
     self.street_browser_dk = street_browser_dk
     self.iface = iface
     self.canvas = self.iface.mapCanvas()
     self.db = db
     self.zoom_funct = ZoomSelectCanvas(self.iface, self.street_browser_dk,
                                        self.db)
     self.layer = esu_layer
     self.toolbar = toolbar
     # Data widget mapper used in sb
     self.mapper = mapper
     # Set hand cursor
     self.cursor = QCursor(Qt.PointingHandCursor)
     # Create street selector dialog
     self.street_sel_dlg = StreetSelectorDlg()
     self.street_sel_dlg.setWindowFlags(Qt.Window | Qt.WindowTitleHint
                                        | Qt.CustomizeWindowHint)
     # Connect street selector buttons
     self.connect_actions()
     QgsMapToolIdentify.__init__(self, self.canvas)
 def __init__(self, canvas, pickMode='selection'):
     self.canvas = canvas
     QgsMapToolIdentify.__init__(self, canvas)
     self.setCursor(QCursor())
     if pickMode == 'all':
         self.selectionMode = self.TopDownStopAtFirst
     elif pickMode == 'selection':
         self.selectionMode = self.LayerSelection
     elif pickMode == 'active':
         self.selectionMode = self.ActiveLayer
Esempio n. 8
0
    def __init__(self, iface):
        QgsMapToolIdentify.__init__(self, iface.mapCanvas())
        self.iface = iface
        FieldRestrictionTypeUtilsMixin.__init__(self, iface)

        try:
            self.SIGN_TYPES = QgsProject.instance().mapLayersByName(
                "SignTypes")[0]
            self.MHTC_CHECK_ISSUE_TYPES = QgsProject.instance(
            ).mapLayersByName("MHTC_CheckIssueTypes")[0]
        except:
            None  # if "Signs" is not present
Esempio n. 9
0
 def __init__(self, gtoObj, canvas, config, cursorstyle=Qt.CrossCursor):
     self.info = gtoObj.info
     self.debug = gtoObj.debug
     self.canvas = canvas
     self.layer = None
     QgsMapToolIdentify.__init__(self, canvas)
     try:
         cursor = QCursor()
         cursor.setShape(cursorstyle)
         self.setCursor(cursor)
         # metadata
         layer = config.get("layer", None)
         if layer is not None:
             self.layer = QgsProject.instance().mapLayersByName(layer)[0]
         self.smallest = config.get("smallest", True)
         if self.debug: self.info.log("SelectPolygonTool::init")
     except Exception as e:
         self.info.err(e)
Esempio n. 10
0
 def __init__(self, canvas, targetLayer):
     self.canvas = canvas
     self.targetLayer = targetLayer
     QgsMapToolIdentify.__init__(self, canvas)
     self.setCursor(QCursor())
Esempio n. 11
0
 def __init__(self, iface):
     QgsMapToolIdentify.__init__(self, iface.mapCanvas())
     self.iface = iface
     FieldRestrictionTypeUtilsMixin.__init__(self, iface)
Esempio n. 12
0
 def __init__(self, iface):
     QgsMapToolIdentify.__init__(self, iface.mapCanvas())
     self.iface = iface
Esempio n. 13
0
 def __init__(self, canvas, layerList, DEM=None):
     self.canvas = canvas
     self.layerList = layerList
     self.DEM = DEM
     QgsMapToolIdentify.__init__(self, canvas)
     self.setCursor(QCursor())
Esempio n. 14
0
 def __init__(self, canvas):
     self.canvas = canvas
     QgsMapToolIdentify.__init__(self, canvas)
     self.setCursor(QCursor())
Esempio n. 15
0
 def __init__(self, canvas, layerType='AllLayers'):
     QgsMapToolIdentify.__init__(self, canvas)
     self.layerType = getattr(QgsMapToolIdentify, layerType)
     self.canvas = canvas
     self.setCursor(QCursor(Qt.PointingHandCursor))
     self.applicationSettings = ApplicationSettings()
Esempio n. 16
0
 def __init__(self, canvas, targetLayer):
     self.canvas = canvas
     self.targetLayer = targetLayer
     QgsMapToolIdentify.__init__(self, canvas)
     self.setCursor(QCursor())
 def __init__(self, canvas, layerType='AllLayers'):
     QgsMapToolIdentify.__init__(self, canvas)
     self.layerType = getattr(QgsMapToolIdentify, layerType)
     self.canvas = canvas
     self.setCursor(QCursor())
 def __init__(self, canvas):
     self.canvas = canvas
     QgsMapToolIdentify.__init__(self, canvas)
Esempio n. 19
0
 def __init__(self, canvas, pickMode='all', cursorstyle=Qt.CrossCursor, layers=None):
     self.canvas = canvas
     QgsMapToolIdentify.__init__(self, canvas)
     self.setCursorStyle(cursorstyle)
     self.setPickMode(pickMode)
     self.layers = layers
Esempio n. 20
0
 def __init__(self, canvas):
     self.canvas = canvas
     QgsMapToolIdentify.__init__(self, canvas)
     self.setCursor(QCursor(QPixmap(Cursor), 1, 6))
Esempio n. 21
0
 def __init__(self, canvas):
     self.canvas = canvas
     QgsMapToolIdentify.__init__(self, canvas)
     self.setCursor(QCursor(QPixmap(Cursor), 1, 6))
Esempio n. 22
0
 def __init__(self, parentInstance, targetLayer):
     self.parentInstance = parentInstance
     self.canvas = parentInstance.canvas
     self.targetLayer = targetLayer
     QgsMapToolIdentify.__init__(self, self.canvas)
     self.setCursor(QCursor())