mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-06 00:07:29 -04:00
[vector tiles] Handle 'to-boolean' mapboxgl expressions when importing styles
This commit is contained in:
parent
0aca4bb1e3
commit
cdf7c82d7a
@ -3428,6 +3428,10 @@ QString QgsMapBoxGlStyleConverter::parseExpression( const QVariantList &expressi
|
||||
{
|
||||
return QStringLiteral( "to_string(%1)" ).arg( parseExpression( expression.value( 1 ).toList(), context ) );
|
||||
}
|
||||
else if ( op == QLatin1String( "to-boolean" ) )
|
||||
{
|
||||
return QStringLiteral( "to_bool(%1)" ).arg( parseExpression( expression.value( 1 ).toList(), context ) );
|
||||
}
|
||||
else if ( op == QLatin1String( "case" ) )
|
||||
{
|
||||
QString caseString = QStringLiteral( "CASE" );
|
||||
|
@ -529,6 +529,9 @@ class TestQgsMapBoxGlStyleConverter(QgisTestCase):
|
||||
conversion_context),
|
||||
'''"name"''')
|
||||
|
||||
self.assertEqual(QgsMapBoxGlStyleConverter.parseExpression(["to-boolean", ["get", "name"]],
|
||||
conversion_context),
|
||||
'''to_bool("name")''')
|
||||
self.assertEqual(QgsMapBoxGlStyleConverter.parseExpression(["to-string", ["get", "name"]],
|
||||
conversion_context),
|
||||
'''to_string("name")''')
|
||||
|
Loading…
x
Reference in New Issue
Block a user