[Qgis-developer] Adding vertex marker to Google layers -> very slow

Goo Creations goocreations at gmail.com
Fri Apr 8 05:28:41 EDT 2011


Hi all

I create a QgsVertexMarker and add it to the canvas:

*marker = QgsVertexMarker(self.iface.mapCanvas())
marker.setCenter(point)
marker.setColor(QColor(0,255,0))
marker.setIconSize(5)
marker.setIconType(QgsVertexMarker.ICON_CROSS)
marker.setPenWidth(3)
self.iface.mapCanvas().refresh()

*
*When I do this the marker is successfully added to the canvas. Everything
is fine, when the layers loaded to the canvas are locally available (eg:
normal raster or vector layers).
The problem comes in with remote layers such as Google layers. When I use
the code above on a canvas with a Google layer, it takes extremely long to
"add" the marker.
The problem lies in: **self.iface.mapCanvas().refresh(). As far as I can
see, refresh() reloads the entire visible area, thus requesting the image
again from the Google server and slowing done the entire process.

Is there a better way to add a vertex, without reloading the entire image?
I've tried self.iface.mapCanvas().scene().update() and marker.show() instead
of the refresh() statement, but then the vertex isn't drawn.


Chris
*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/qgis-developer/attachments/20110408/076ff2a0/attachment-0001.html


More information about the Qgis-developer mailing list