Opened 14 years ago
Closed 13 years ago
#2150 closed bug (worksforme)
QgsMapCanvas.refresh() doesn't reload WMS layer
Reported by: | trapanator | Owned by: | nobody |
---|---|---|---|
Priority: | major: does not work as expected | Milestone: | Version 1.7.0 |
Component: | MapCanvas | Version: | Trunk |
Keywords: | Cc: | ||
Must Fix for Release: | Yes | Platform: | Windows |
Platform Version: | Awaiting user input: | no |
Description
In a plugin I add a feature to a PostGIS layer. I have another WMS raster layer connected to this PostGIS layer.
If I invoke the command:
QgsMapCanvas.refresh()
it refreshes the map but not the WMS layer. A workaround is this (note: 'e' variable is QMouseEvent type):
self.myCanvas.panAction(e) self.myCanvas.panActionEnd(QPoint (e.x(), e.y()))
Change History (3)
comment:1 by , 14 years ago
Milestone: | Version 1.5.0 → Version 1.6.0 |
---|
comment:2 by , 13 years ago
Milestone: | Version 1.6.0 → Version 1.7.0 |
---|
comment:3 by , 13 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Try to reload the layers before refreshing the canvas (that's how qgisapp does it):
C++: QgsMapLayerRegistry::instance()->reloadAllLayers(); mMapCanvas->refresh();
Python: QgsMapLayerRegistry.instance().reloadAllLayers() qgis.utils.iface.mapCanvas().refresh()
Hope it works (otherwise reopen the ticket)