Hello all,<div><br></div><div>I&#39;ve written a piece of code that will search a database for a given point, and then return that point so we can center the map canvas on it and zoom in.  Unfortunately, it&#39;s not working.  QGIS crashes after the code executes, leaving no error messages behind.  Is there a better way to center/zoom to a given point?  I&#39;ve tried the canvas method &quot;centerWithZoom&quot; as well, with no success.  (It also crashes.)  I have checked my coords -- they are in the proper projection (the same as the mapCanvas) and I haven&#39;t reversed them.  Any other ideas/methods of accomplishing this are greatly appreciated.  Thanks!</div>
<div><br></div><div>Aaron</div><div><br></div><div><div>      x = result[0][1]</div><div>      y = result[0][2]</div><div>      xscale = 1.0</div><div><br></div><div>      # Get the map canvas</div><div>      mc = self.plugin.iface.mapCanvas()</div>
<div><br></div><div>      height2 = mc.extent().height() * xscale / 2.0</div><div>      width2 = mc.extent().width() * xscale / 2.0</div><div><br></div><div>      rect = QgsRectangle(x-width2,y-height2,x+width2,y+height2)</div>
<div><br></div><div>      # Set the extent to our new rectangle</div><div>      mc.setExtent(rect)</div><div><br></div><div>      # Refresh the map</div><div>      mc.refresh()</div></div>