|
@@ -365,11 +365,24 @@ void TestQgsAppLocatorFilters::testGoto() |
|
|
QCOMPARE( results.at( 0 ).userData.toMap()[QStringLiteral( "point" )].value<QgsPointXY>(), QgsPointXY( 1234.56, 789.012 ) ); |
|
|
|
|
|
// degree/minuste/second coordinates goto |
|
|
// easting northing |
|
|
results = gatherResults( &filter, QStringLiteral( "40deg 1' 0\" E 11deg 55' 0\" S" ), QgsLocatorContext() ); |
|
|
QCOMPARE( results.count(), 1 ); |
|
|
QCOMPARE( results.at( 0 ).displayString, QObject::tr( "Go to 40.01666667° -11.91666667° (EPSG:4326 - WGS 84)" ) ); |
|
|
QCOMPARE( results.at( 0 ).userData.toMap()[QStringLiteral( "point" )].value<QgsPointXY>(), QgsPointXY( 40.0166666667, -11.9166666667 ) ); |
|
|
|
|
|
// northing easting |
|
|
results = gatherResults( &filter, QStringLiteral( "14°49′48″N 01°48′45″E" ), QgsLocatorContext() ); |
|
|
QCOMPARE( results.count(), 1 ); |
|
|
QCOMPARE( results.at( 0 ).displayString, QObject::tr( "Go to 1.8125° 14.83° (EPSG:4326 - WGS 84)" ) ); |
|
|
QCOMPARE( results.at( 0 ).userData.toMap()[QStringLiteral( "point" )].value<QgsPointXY>(), QgsPointXY( 1.8125, 14.83 ) ); |
|
|
|
|
|
// northing, esting (comma separated) |
|
|
results = gatherResults( &filter, QStringLiteral( "14°49′48″N, 01°48′45″E" ), QgsLocatorContext() ); |
|
|
QCOMPARE( results.count(), 1 ); |
|
|
QCOMPARE( results.at( 0 ).displayString, QObject::tr( "Go to 1.8125° 14.83° (EPSG:4326 - WGS 84)" ) ); |
|
|
QCOMPARE( results.at( 0 ).userData.toMap()[QStringLiteral( "point" )].value<QgsPointXY>(), QgsPointXY( 1.8125, 14.83 ) ); |
|
|
|
|
|
// OSM/Leaflet/OpenLayers |
|
|
results = gatherResults( &filter, QStringLiteral( "https://www.openstreetmap.org/#map=15/44.5546/6.4936" ), QgsLocatorContext() ); |
|
|
QCOMPARE( results.count(), 1 ); |
|
|