Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[locator] Fix broken parsing of google maps URL Z values
- Loading branch information
|
@@ -1100,9 +1100,9 @@ void QgsGotoLocatorFilter::fetchResults( const QString &string, const QgsLocator |
|
|
|
|
|
if ( okX && okY ) |
|
|
{ |
|
|
if ( match.captured( 2 ) == QChar( 'z' ) && scales.contains( params.at( 2 ).toInt() ) ) |
|
|
if ( match.captured( 2 ) == QChar( 'z' ) && scales.contains( static_cast<int>( params.at( 2 ).toDouble() ) ) ) |
|
|
{ |
|
|
scale = scales.value( params.at( 2 ).toInt() ); |
|
|
scale = scales.value( static_cast<int>( params.at( 2 ).toDouble() ) ); |
|
|
} |
|
|
else if ( match.captured( 2 ) == QChar( 'm' ) ) |
|
|
{ |
|
|
|
@@ -391,7 +391,7 @@ void TestQgsAppLocatorFilters::testGoto() |
|
|
QCOMPARE( results.at( 0 ).userData.toMap()[QStringLiteral( "scale" )].toDouble(), 22569.0 ); |
|
|
|
|
|
// Google Maps |
|
|
results = gatherResults( &filter, QStringLiteral( "https://www.google.com/maps/@44.5546,6.4936,15z" ), QgsLocatorContext() ); |
|
|
results = gatherResults( &filter, QStringLiteral( "https://www.google.com/maps/@44.5546,6.4936,15.25z" ), QgsLocatorContext() ); |
|
|
QCOMPARE( results.count(), 1 ); |
|
|
QCOMPARE( results.at( 0 ).displayString, QObject::tr( "Go to 6.4936° 44.5546° at scale 1:22569 (EPSG:4326 - WGS 84)" ) ); |
|
|
QCOMPARE( results.at( 0 ).userData.toMap()[QStringLiteral( "point" )].value<QgsPointXY>(), QgsPointXY( 6.4936, 44.5546 ) ); |
|
|