Skip to content

Commit 8ecae4f

Browse files
committed
[bugfix] Bookmarks fix zoom to with coordinate transform
Forward port of an unreported bug introduced by me when I changed the display value to EPSG:xxxx
1 parent aa68a9f commit 8ecae4f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/app/qgsbookmarks.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -234,15 +234,15 @@ void QgsBookmarks::zoomToBookmark()
234234
double ymin = index.sibling( index.row(), 4 ).data().toDouble();
235235
double xmax = index.sibling( index.row(), 5 ).data().toDouble();
236236
double ymax = index.sibling( index.row(), 6 ).data().toDouble();
237-
int srid = index.sibling( index.row(), 7 ).data().toInt();
237+
QString authid = index.sibling( index.row(), 7 ).data().toString();
238238

239239
QgsRectangle rect = QgsRectangle( xmin, ymin, xmax, ymax );
240240

241241
// backwards compatibility, older version had -1 in the srid column
242-
if ( srid > 0 &&
243-
srid != QgisApp::instance()->mapCanvas()->mapSettings().destinationCrs().srsid() )
242+
if ( ! authid.isEmpty( ) &&
243+
authid != QgisApp::instance()->mapCanvas()->mapSettings().destinationCrs().authid() )
244244
{
245-
QgsCoordinateTransform ct( QgsCoordinateReferenceSystem::fromSrsId( srid ),
245+
QgsCoordinateTransform ct( QgsCoordinateReferenceSystem::fromOgcWmsCrs( authid ),
246246
QgisApp::instance()->mapCanvas()->mapSettings().destinationCrs() );
247247
rect = ct.transform( rect );
248248
if ( rect.isEmpty() )

0 commit comments

Comments
 (0)