<div dir="ltr"><div>Hi,</div><div><br></div><div>I have a QgsComposerMap that I want to zoom to the extent of a feature in a vector layer.</div><div><br></div><div><div>geomBBRect = geometry.boundingBox()<br></div><div>myComposerMap.zoomToExtent(geomBBRect)</div></div><div><br></div><div>I am trying to use zoomToExtent to make the map show the correct area. However, I get a blank map when I run my code. If I check what the current scale is, its returned as 'nan'.</div><div><br></div><div>I tried using setNewExtent() before, but this alters the size of my QgsComposerMap. I want to keep the same map size each time.</div><div><br></div><div>After doing a little bit of checking, it seems that:</div><div><br></div><div>myComposerMap.currentMapExtent().xMinimum()))</div><div>myComposerMap.currentMapExtent().xMaximum()))</div><div><br></div><div>both return 'nan' but yMinimum and yMaximum return coordinates.</div><div><br></div><div>I can not figure out why. Can anyone help shed any light on the problem? I can provide more code if needed.</div><div><br></div><div>James</div><div><br></div></div>