[Qgis-developer] enabling the overview map

SJWC GIS sjwcgis at gmail.com
Thu Apr 5 12:00:36 EDT 2012


Thanks Larry, that's what I was looking for!

On Wed, Apr 4, 2012 at 9:47 PM, Larry Shaffer <larrys at dakotacarto.com>wrote:

> Hi Aaron,
>
> On Wed, Apr 4, 2012 at 5:27 PM, SJWC GIS <> wrote:
>
>> Hello,  I'm creating a plugin that modifies the qgis interface defaults
>> when it's installed.  One of the things I'm trying to do is turn on the
>> overview map by default.  I haven't found a way to do it yet.  I could only
>> get as close as...
>>
>> self.iface.mapCanvas().enableOverviewMode(QgsMapOverviewCanvas(None,
>> self.iface.mapCanvas()))
>>
>> This ends up crashing qgis altogether.  I'm guessing it has something to
>> do with the fact that I have no reference to the existing overview map
>> object, and trying to create a new one is bad news.  Any insight you could
>> provide on the best way to accomplish such things (and where in the api I
>> can look for answers like this) would be much appreciated.  Thanks!
>>
>
> I think the overview object is already created on project load (if the
> project has one).
>
> If you are looking to just show/hide it's dock widget, try...
>
>     overview = iface.mainWindow().findChild(QDockWidget, "Overview")
>     if overview:
>         overview.show()  # or hide(), etc.
>
> Regards,
>
> Larry Shaffer
> Dakota Cartography
> Black Hills, South Dakota
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/qgis-developer/attachments/20120405/6523be59/attachment.html


More information about the Qgis-developer mailing list