本文整理汇总了Python中qgis.gui.QgsRubberBand类的典型用法代码示例。如果您正苦于以下问题:Python QgsRubberBand类的具体用法?Python QgsRubberBand怎么用?Python QgsRubberBand使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QgsRubberBand类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: startCapturing
def startCapturing(self):
self.clearScene()
self.rubberBand = QgsRubberBand(self.canvas, QGis.Polygon)
self.rubberBand.setWidth(2)
self.rubberBand.setFillColor(QColor(220, 0, 0, 120))
self.rubberBand.setBorderColor(QColor(220, 0, 0))
self.rubberBand.setLineStyle(Qt.DotLine)
self.rubberBand.show()
self.tempRubberBand = QgsRubberBand(self.canvas, QGis.Polygon)
self.tempRubberBand.setWidth(2)
self.tempRubberBand.setFillColor(QColor(0, 0, 0, 0))
self.tempRubberBand.setBorderColor(QColor(220, 0, 0))
self.tempRubberBand.setLineStyle(Qt.DotLine)
self.tempRubberBand.show()
self.vertexMarker = QgsVertexMarker(self.canvas)
self.vertexMarker.setIconType(1)
self.vertexMarker.setColor(QColor(220, 0, 0))
self.vertexMarker.setIconSize(16)
self.vertexMarker.setPenWidth(3)
self.vertexMarker.show()
self.capturing = True
开发者ID:APIS-Luftbildarchiv,项目名称:APIS,代码行数:25,代码来源:apis_map_tools.py
示例2: QgepMapTool
class QgepMapTool( QgsMapTool ):
'''
Base class for all the map tools
'''
highLightedPoints = []
logger = logging.getLogger( __name__ )
def __init__( self, iface, button ):
QgsMapTool.__init__( self, iface.mapCanvas() )
self.canvas = iface.mapCanvas()
self.cursor = QCursor( Qt.CrossCursor )
self.button = button
self.msgBar = iface.messageBar()
settings = QSettings()
currentProfileColor = settings.value( "/QGEP/CurrentProfileColor", u'#FF9500' )
self.rubberBand = QgsRubberBand( self.canvas )
self.rubberBand.setColor( QColor( currentProfileColor ) )
self.rubberBand.setWidth( 3 )
# Gets called when the tool is activated
def activate( self ):
QgsMapTool.activate( self )
self.canvas.setCursor( self.cursor )
self.button.setChecked( True )
# Gets called whenever the tool is deactivated directly or indirectly
def deactivate( self ):
QgsMapTool.deactivate( self )
self.button.setChecked( False )
def isZoomTool( self ):
return False
def setCursor( self, cursor ):
self.cursor = QCursor( cursor )
#===========================================================================
# Events
#===========================================================================
def canvasMoveEvent( self, event ):
try:
self.mouseMoved( event )
except AttributeError:
pass
def canvasReleaseEvent( self, event ):
if event.button() == Qt.RightButton:
self.rightClicked ( event )
else:
self.leftClicked( event )
def canvasDoubleClickEvent( self, event ):
try:
self.doubleClicked( event )
except AttributeError:
pass
开发者ID:camptocamp,项目名称:QGEP,代码行数:60,代码来源:qgepmaptools.py
示例3: __init__
def __init__(self, canvas, iface):
"""
Tool Behaviours: (all behaviours start edition, except for rectangle one)
1- Left Click: Clears previous selection, selects feature, sets feature layer as active layer.
The selection is done with the following priority: Point, Line then Polygon.
Selection is only done in visible layer.
2- Control + Left Click: Adds to selection selected feature. This selection follows the priority in item 1.
3- Right Click: Opens feature form
4- Control + Right Click: clears selection and set feature's layer as activeLayer. activeLayer's definition
follows priority of item 1;
5- Shift + drag and drop: draws a rectangle, then features that intersect this rectangl'e are added to selection
"""
self.iface = iface
self.canvas = canvas
self.toolAction = None
QgsMapTool.__init__(self, self.canvas)
self.rubberBand = QgsRubberBand(self.canvas, QGis.Polygon)
self.hoverRubberBand = QgsRubberBand(self.canvas, QGis.Polygon)
mFillColor = QColor( 254, 178, 76, 63 )
self.rubberBand.setColor(mFillColor)
self.hoverRubberBand.setColor(QColor( 255, 0, 0, 90 ))
self.rubberBand.setWidth(1)
self.reset()
self.blackList = self.getBlackList()
self.cursorChanged = False
self.cursorChangingHotkey = QtCore.Qt.Key_Alt
self.menuHovered = False # indicates hovering actions over context menu
开发者ID:lcoandrade,项目名称:DsgTools,代码行数:27,代码来源:multiLayerSelect.py
示例4: __init__
def __init__(self, iface):
self.iface = iface
self.canvas = iface.mapCanvas()
QgsMapToolEmitPoint.__init__(self, self.canvas)
self.rasterShadow = RasterShadowMapCanvasItem(self.canvas)
self.firstPoint = None
self.rubberBandOrigin = QgsRubberBand(
self.canvas, QgsWkbTypes.PointGeometry)
self.rubberBandOrigin.setColor(Qt.red)
self.rubberBandOrigin.setIcon(QgsRubberBand.ICON_CIRCLE)
self.rubberBandOrigin.setIconSize(7)
self.rubberBandOrigin.setWidth(2)
self.rubberBandDisplacement = QgsRubberBand(
self.canvas, QgsWkbTypes.LineGeometry)
self.rubberBandDisplacement.setColor(Qt.red)
self.rubberBandDisplacement.setWidth(1)
self.rubberBandExtent = QgsRubberBand(
self.canvas, QgsWkbTypes.LineGeometry)
self.rubberBandExtent.setColor(Qt.red)
self.rubberBandExtent.setWidth(2)
self.isLayerVisible = True
self.reset()
开发者ID:gvellut,项目名称:FreehandRasterGeoreferencer,代码行数:29,代码来源:freehandrastergeoreferencer_maptools.py
示例5: initGui
def initGui(self):
#Models
self.tblChanges.setModel( ChangeModel() )
proxyChanges = HistoryProxyModel()
proxyChanges.setSourceModel( HistoryModel() )
self.tblHistory.setModel( proxyChanges )
#Signals
self.plugin.tvIdentificationResult.model().sourceModel().on_history.connect( self.historyChanged )
self.tblHistory.selectionModel().currentChanged.connect( self.currentHistoryChanged )
#Widgets
settings = QSettings()
self.mapCanvas = QgsMapCanvas(self.vSplitter)
self.mapCanvas.setDestinationCrs( QgsCoordinateReferenceSystem('EPSG:4326') )
zoomFactor = settings.value( "/qgis/zoom_factor", 2.0, type=float )
action = settings.value( "/qgis/wheel_action", 0, type=int)
self.mapCanvas.setWheelFactor( zoomFactor )
self.mapCanvas.enableAntiAliasing( settings.value( "/qgis/enable_anti_aliasing", False, type=bool ))
#self.mapCanvas.useImageToRender( settings.value( "/qgis/use_qimage_to_render", False, type=bool ))
self.toolPan = QgsMapToolPan( self.mapCanvas )
self.mapCanvas.setMapTool( self.toolPan )
#Canvas items
self.new_geometry = QgsRubberBand(self.mapCanvas)
self.new_geometry.setWidth(2)
self.new_geometry.setIcon( QgsRubberBand.ICON_CIRCLE )
g = QColor(0, 128, 0, 100)
self.new_geometry.setColor( g )
self.old_geometry = QgsRubberBand(self.mapCanvas)
self.old_geometry.setWidth(2)
self.old_geometry.setIcon( QgsRubberBand.ICON_CIRCLE )
r = QColor(255, 0, 0, 100)
self.old_geometry.setColor( r )
开发者ID:gis-support,项目名称:DIVI-QGIS-Plugin,代码行数:31,代码来源:history_dialog.py
示例6: __init__
def __init__(self, iface, couleur):
canvas = iface.mapCanvas()
QgsMapTool.__init__(self, canvas)
self.canvas = canvas
self.iface = iface
self.rb = QgsRubberBand(self.canvas, QgsWkbTypes.PolygonGeometry)
self.rb.setColor(couleur)
self.rbSelect = QgsRubberBand(self.canvas, QgsWkbTypes.PolygonGeometry)
return None
开发者ID:jeremyk6,项目名称:qdraw,代码行数:9,代码来源:drawtools.py
示例7: __init__
def __init__(self, iface):
"""Constructor.
:param iface: An interface instance that will be passed to this class
which provides the hook by which you can manipulate the QGIS
application at run time.
:type iface: QgsInterface
"""
# Save reference to the QGIS interface
super(EarthMineQGIS, self).__init__()
self.movingfeature = None
self.iface = iface
self.viewer = None
self.canvas = self.iface.mapCanvas()
self.settings = QSettings()
# initialize plugin directory
self.plugin_dir = os.path.dirname(__file__)
# initialize locale
locale = QSettings().value("locale/userLocale")[0:2]
locale_path = os.path.join(self.plugin_dir, "i18n", "EarthMineQGIS_{}.qm".format(locale))
if os.path.exists(locale_path):
self.translator = QTranslator()
self.translator.load(locale_path)
if qVersion() > "4.3.3":
QCoreApplication.installTranslator(self.translator)
self.pointtool = QgsMapToolEmitPoint(self.canvas)
self.pointtool.canvasClicked.connect(self.set_viewer_location)
self.settingsdialog = SettingsDialog(self.iface.mainWindow())
self.actions = []
self.menu = self.tr(u"&Earthmine")
self.toolbar = self.iface.addToolBar(u"EarthMineQGIS")
self.toolbar.setObjectName(u"EarthMineQGIS")
self.legend = self.iface.legendInterface()
emcolor = QColor(1, 150, 51)
self.tempband = QgsRubberBand(self.canvas, QGis.Line)
self.tempband.setWidth(5)
self.tempband.setColor(emcolor)
self.tempbandpoints = QgsRubberBand(self.canvas, QGis.Point)
self.tempbandpoints.setWidth(7)
self.tempbandpoints.setColor(emcolor)
self.movingband = QgsRubberBand(self.canvas, QGis.Point)
self.movingband.setWidth(5)
self.movingband.setColor(emcolor)
self.layersignals = []
self.marker = None
开发者ID:michaelborck,项目名称:earthmine-qgis,代码行数:56,代码来源:earthmine_qgis.py
示例8: __init__
def __init__(self, layer, feature, mapCanvas, parent=None):
QDialog.__init__(self, parent)
self.setupUi(self)
self.settings = MySettings()
SettingDialog.__init__(self, self.settings, False, True)
self.mapCanvas = mapCanvas
self.setAttribute(Qt.WA_DeleteOnClose)
self.feature = feature
self.initialGeometry = QgsGeometry(feature.geometry())
self.layer = layer
# close if no geom, hide "sketch current point" if not needed
geomType = layer.geometryType()
if not geomType in (QGis.Point, QGis.Line, QGis.Polygon):
self.close()
return
if geomType == QGis.Point:
self.pointRubberGroup.hide()
# editors management
self.editorLayout = QGridLayout(self.editorContainer)
self.editor = GeomEditor(layer, feature.geometry())
self.displayCombo.setCurrentIndex(0)
self.displayCombo.currentIndexChanged.connect(self.setEditor)
self.setEditor()
# rubber bands
self.featureRubber = QgsRubberBand(mapCanvas)
self.currentPointRubber = QgsRubberBand(mapCanvas)
self.settings.setting("featureRubberColor").valueChanged.connect(self.updateFeatureRubber)
self.settings.setting("featureRubberSize").valueChanged.connect(self.updateFeatureRubber)
self.settings.setting("currentPointRubberSize").valueChanged.connect(self.updateCurrentPointRubber)
self.settings.setting("currentPointRubberColor").valueChanged.connect(self.updateCurrentPointRubber)
self.settings.setting("currentPointRubberIcon").valueChanged.connect(self.updateCurrentPointRubber)
self.updateFeatureRubber()
self.updateCurrentPointRubber()
self.geometryChanged()
# GUI signals connection
self.applyButton.clicked.connect(self.applyGeometry)
self.resetButton.clicked.connect(self.resetGeometry)
self.sketchGeometry.clicked.connect(self.geometryChanged)
self.displayPointRubber.clicked.connect(self.currentPointRubber.reset)
self.layerEditable()
layer.editingStopped.connect(self.layerEditable)
layer.editingStarted.connect(self.layerEditable)
# set texts in UI
self.layerLabel.setText(layer.name())
try:
featureTitle = unicode(feature[layer.displayField()])
except KeyError:
featureTitle = ""
if featureTitle == "":
featureTitle = str(feature.id())
self.featureEdit.setText(featureTitle)
开发者ID:jeffdefacto,项目名称:plaingeometryeditor,代码行数:56,代码来源:geomeditordialog.py
示例9: getSnapRubberBand
def getSnapRubberBand(self):
rubberBand = QgsRubberBand(self.canvas, geometryType = QGis.Point)
rubberBand.setFillColor(QColor(255, 0, 0, 40))
rubberBand.setBorderColor(QColor(255, 0, 0, 200))
rubberBand.setWidth(2)
rubberBand.setIcon(QgsRubberBand.ICON_X)
return rubberBand
开发者ID:lcoandrade,项目名称:DsgTools,代码行数:7,代码来源:geometricaAquisition.py
示例10: _draw_rubberband
def _draw_rubberband(self, geometry, colour, width):
"""Draw a rubber band on the canvas.
.. versionadded: 2.2.0
:param geometry: Extent that the rubber band should be drawn for.
:type geometry: QgsGeometry
:param colour: Colour for the rubber band.
:type colour: QColor
:param width: The width for the rubber band pen stroke.
:type width: int
:returns: Rubber band that should be set to the extent.
:rtype: QgsRubberBand
"""
# noinspection PyArgumentList
rubber_band = QgsRubberBand(
self._map_canvas, geometryType=QGis.Polygon)
rubber_band.setBrushStyle(Qt.NoBrush)
rubber_band.setColor(colour)
rubber_band.setWidth(width)
rubber_band.setToGeometry(geometry, None)
return rubber_band
开发者ID:timlinux,项目名称:inasafe,代码行数:25,代码来源:extent.py
示例11: loadLines
def loadLines(self, lines, points, markers, suffix):
no = self.project.readEntry("TUVIEW", "lines{0}no".format(suffix))[0]
if no:
no = int(no)
for i in range(no):
a = self.project.readEntry("TUVIEW", 'lines{0}x{1}'.format(suffix, i))[0]
a = a.split('~~')
b = self.project.readEntry("TUVIEW", 'lines{0}y{1}'.format(suffix, i))[0]
b = b.split('~~')
points.clear()
for j in range(len(a)):
x = float(a[j])
y = float(b[j])
point = QgsPoint(x, y)
points.append(point)
if i + 1 == no:
marker = QgsVertexMarker(self.tuView.canvas)
if suffix == 'cs':
marker.setColor(Qt.red)
marker.setIconSize(10)
marker.setIconType(QgsVertexMarker.ICON_BOX)
else: # 'q'
marker.setColor(Qt.blue)
marker.setIconSize(12)
marker.setIconType(QgsVertexMarker.ICON_DOUBLE_TRIANGLE)
marker.setCenter(QgsPointXY(point))
markers.append(marker)
line = QgsRubberBand(self.tuView.canvas, False)
line.setWidth(2)
if suffix == 'cs':
line.setColor(QColor(Qt.red))
else: # 'q'
line.setColor(QColor(Qt.blue))
line.setToGeometry(QgsGeometry.fromPolyline(points), None)
lines.append(line)
开发者ID:TUFLOW-Support,项目名称:QGIS-TUFLOW-Plugin,代码行数:35,代码来源:tuflowqgis_tuproject.py
示例12: zoomAndShowWKT
def zoomAndShowWKT(self, wtk):
geom = QgsGeometry.fromWkt(wtk)
canvas = self.iface.mapCanvas()
self.clear()
r = QgsRubberBand(canvas, geom.type() == 3 )
r.setToGeometry(geom, None)
r.setColor(QColor(0, 0, 255))
r.setFillColor(QColor(0, 0, 255, 50))
r.setWidth(3)
pt = geom.pointOnSurface().asPoint()
m = QgsVertexMarker(canvas)
m.setCenter( pt )
m.setColor(QColor(0, 0, 255))
m.setIconSize(5)
m.setIconType(QgsVertexMarker.ICON_BOX)
m.setPenWidth(3)
if geom.type() == 3 or geom.type() == 2:
rec = geom.boundingBox()
canvas.setExtent(rec)
else:
self.moveMapTo( pt[0], pt[1], 0)
self.graphics.append(r)
self.graphics.append(m)
self._refresh_layers()
开发者ID:milieuinfo,项目名称:OmgevingsAnalyse,代码行数:28,代码来源:htmlInteraction.py
示例13: __init__
def __init__(self, iface, layer):
QgsMapToolAdvancedDigitizing.__init__(self, iface.mapCanvas(), iface.cadDockWidget())
self.iface = iface
self.canvas = iface.mapCanvas()
self.layer = layer
self.rubberband = QgsRubberBand(iface.mapCanvas(), layer.geometryType())
self.rubberband.setColor(QColor("#ee5555"))
self.rubberband.setWidth(1)
self.tempRubberband = QgsRubberBand(iface.mapCanvas(), layer.geometryType())
self.tempRubberband.setColor(QColor("#ee5555"))
self.tempRubberband.setWidth(1)
self.tempRubberband.setLineStyle(Qt.DotLine)
开发者ID:QGEP,项目名称:qgepplugin,代码行数:12,代码来源:qgepmaptooladdfeature.py
示例14: __init__
def __init__(self, iface, layer):
QgsMapTool.__init__(self, iface.mapCanvas() )
self.iface = iface
self.canvas = iface.mapCanvas()
self.layer = layer
self.rubberband = QgsRubberBand( iface.mapCanvas(), layer.geometryType() )
self.rubberband.setColor( QColor( "#ee5555" ) )
self.rubberband.setWidth( 2 )
self.tempRubberband = QgsRubberBand( iface.mapCanvas(), layer.geometryType() )
self.tempRubberband.setColor( QColor( "#ee5555" ) )
self.tempRubberband.setWidth( 2 )
self.tempRubberband.setLineStyle(Qt.DotLine)
开发者ID:wbyne,项目名称:QGEP,代码行数:12,代码来源:qgepmaptooladdfeature.py
示例15: addGraphic
def addGraphic(self, geom ):
canvas = self.iface.mapCanvas()
rBand = QgsRubberBand(canvas, True)
self.graphics.append( rBand )
rBand.setToGeometry( geom, None )
rBand.setColor(QtGui.QColor(0,0,255, 70))
if QGis.QGIS_VERSION_INT >= 20600:
rBand.setBorderColor( QtGui.QColor(0,0,250, 220) )
rBand.setWidth(3)
开发者ID:geopunt,项目名称:geopunt4qgis,代码行数:9,代码来源:geopunt4qgisParcel.py
示例16: __init__
def __init__(self):
self.iface = iface
self.srs_wgs84 = QgsCoordinateReferenceSystem(4326)
self.transformation = QgsCoordinateTransform(self.srs_wgs84, self.srs_wgs84)
self.rb = QgsRubberBand(self.iface.mapCanvas(), QGis.Point)
self.rb.setColor(QColor('magenta'))
self.rb.setIconSize(12)
self.features_rb = QgsRubberBand(self.iface.mapCanvas(), QGis.Point)
self.features_rb.setColor(QColor('green'))
self.features_rb.setIconSize(12)
self.features_rb.setWidth(3)
开发者ID:ANAT01,项目名称:osminfo,代码行数:14,代码来源:rb_result_renderer.py
示例17: initGui
def initGui(self):
self.actions['openInspection'] = QAction(
QIcon(":/plugins/wincan2qgep/icons/wincan_logo.png"),
self.tr(u"Ouvrir une inspection"),
self.iface.mainWindow())
self.actions['openInspection'].triggered.connect(self.openInspection)
self.iface.addPluginToMenu(self.name, self.actions['openInspection'])
self.iface.addToolBarIcon(self.actions['openInspection'])
self.actions['showSettings'] = QAction(
QIcon(":/plugins/wincan2qgep/icons/settings.svg"),
self.tr(u"&Settings"),
self.iface.mainWindow())
self.actions['showSettings'].triggered.connect(self.showSettings)
self.iface.addPluginToMenu(self.name, self.actions['showSettings'])
self.actions['help'] = QAction(
QIcon(":/plugins/wincan2qgep/icons/help.svg"),
self.tr("Help"),
self.iface.mainWindow())
self.actions['help'].triggered.connect(lambda: QDesktopServices().openUrl(QUrl("http://3nids.github.io/wincan2qgep")))
self.iface.addPluginToMenu(self.name, self.actions['help'])
self.rubber = QgsRubberBand(self.iface.mapCanvas())
self.rubber.setColor(QColor(255, 255, 50, 200))
self.rubber.setIcon(self.rubber.ICON_CIRCLE)
self.rubber.setIconSize(15)
self.rubber.setWidth(4)
self.rubber.setBrushStyle(Qt.NoBrush)
开发者ID:rduivenvoorde,项目名称:wincan2qgep,代码行数:29,代码来源:wincan2qgep_plugin.py
示例18: __init__
def __init__(self,iface):
self.iface = iface
QDockWidget.__init__(self)
self.setupUi(self)
self.iface.addDockWidget(Qt.BottomDockWidgetArea,self)
self.canvas = self.iface.mapCanvas()
self.rb = QgsRubberBand(self.canvas, QGis.Point)
self.rb.setColor(QColor( 255, 0, 0, 150 ))
self.searchCacheLimit = 1000
self.wgs84 = QgsCoordinateReferenceSystem()
self.wgs84.createFromSrid(4326)
self.proj = self.canvas.mapRenderer().destinationCrs()
self.transform = QgsCoordinateTransform(self.wgs84, self.proj)
self.bSearch.clicked.connect(self.startSearch)
self.eOutput.currentItemChanged.connect(self.itemChanged)
self.eOutput.clickedOutsideOfItems.connect(self.itemChanged)
self.eText.cleared.connect(self.clearEdit)
self.canvas.mapRenderer().destinationSrsChanged.connect(self.crsChanged)
self.iface.newProjectCreated.connect(self.clearEdit)
self.iface.projectRead.connect(self.clearEdit)
self.cbCenter.stateChanged.connect(self.autocenter)
db = cacheDB()
self.autocompleteList = db.getAutocompleteList()
db.closeConnection()
self.completer = QCompleter(self.autocompleteList)
self.completer.setCaseSensitivity(Qt.CaseInsensitive)
self.eText.setCompleter(self.completer)
开发者ID:p0cisk,项目名称:osmSearch,代码行数:31,代码来源:osmSearchDialog.py
示例19: run
def run(self):
logger.debug(u"run, processing name {}".format(self.processing_name))
logger.debug(u"self.arg {}".format(self.arg))
output_filename = ""
if "NDVI" in self.processing_name:
output_filename = terre_image_processing.ndvi(self.layer, self.working_directory)
if "NDTI" in self.processing_name:
output_filename = terre_image_processing.ndti(self.layer, self.working_directory)
if "Indice de brillance" in self.processing_name:
output_filename = terre_image_processing.brightness(self.layer, self.working_directory)
if "Angle Spectral" in self.processing_name:
self.rubberband = QgsRubberBand(self.canvas, QGis.Point)
self.rubberband.setWidth(10)
self.rubberband.setColor(QColor(Qt.yellow))
if not self.arg:
from spectral_angle import SpectralAngle
self.angle_tool = SpectralAngle(self.iface, self.working_directory, self.layer, self.mirrormap_tool, self.rubberband)
logger.debug("self.angle_tool {}".format(self.angle_tool))
QObject.connect(self.angle_tool, SIGNAL("anglesComputed(PyQt_PyObject)"), self.display)
self.angle_tool.get_point_for_angles(self.layer)
# spectral_angles(self.layer, self.working_directory, self.iface)
else:
output_filename = self.arg
if "KMEANS" in self.processing_name:
if self.arg:
output_filename = terre_image_processing.kmeans(self.layer, self.working_directory, self.arg)
else:
output_filename = terre_image_processing.kmeans(self.layer, self.working_directory)
if "Seuillage" in self.processing_name and self.arg:
logger.debug("this is thrshold")
output_filename = terre_image_processing.threshold(self.layer, self.working_directory, self.arg)
if output_filename:
terre_image_gdal_system.compute_overviews(output_filename)
logger.debug(output_filename)
self.display(output_filename)
开发者ID:CS-SI,项目名称:TerreImage,代码行数:35,代码来源:terre_image_task.py
示例20: setExtent
def setExtent():
if not self.extent is None:
self.canvas.scene().removeItem( self.extent )
self.extent = QgsRubberBand( self.canvas, QGis.Polygon )
self.extent.setBorderColor( QColor( 255, 0 , 0 ) )
self.extent.setWidth( 2 )
self._extent()
开发者ID:lmotta,项目名称:auxiliarywindow_plugin,代码行数:7,代码来源:auxiliarywindow.py
注:本文中的qgis.gui.QgsRubberBand类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论