mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-10 00:04:23 -04:00
Fix loading Google Earth tiles hosted on the cesium ion platform
This commit is contained in:
parent
29369d629a
commit
dac1289340
@ -1004,12 +1004,26 @@ bool QgsCesiumTilesDataProvider::init()
|
|||||||
const QgsNetworkReplyContent content = networkRequest.reply();
|
const QgsNetworkReplyContent content = networkRequest.reply();
|
||||||
const json tileAccessJson = json::parse( content.content().toStdString() );
|
const json tileAccessJson = json::parse( content.content().toStdString() );
|
||||||
|
|
||||||
|
if ( tileAccessJson.contains( "url" ) )
|
||||||
|
{
|
||||||
tileSetUri = QString::fromStdString( tileAccessJson["url"].get<std::string>() );
|
tileSetUri = QString::fromStdString( tileAccessJson["url"].get<std::string>() );
|
||||||
|
}
|
||||||
|
else if ( tileAccessJson.contains( "options" ) )
|
||||||
|
{
|
||||||
|
const auto &optionsJson = tileAccessJson["options"];
|
||||||
|
if ( optionsJson.contains( "url" ) )
|
||||||
|
{
|
||||||
|
tileSetUri = QString::fromStdString( optionsJson["url"].get<std::string>() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( tileAccessJson.contains( "accessToken" ) )
|
||||||
|
{
|
||||||
// The tileset accessToken is NOT the same as the token we use to access the asset details -- ie we can't
|
// The tileset accessToken is NOT the same as the token we use to access the asset details -- ie we can't
|
||||||
// use the same authentication as we got from the providers auth cfg!
|
// use the same authentication as we got from the providers auth cfg!
|
||||||
mHeaders.insert( QStringLiteral( "Authorization" ),
|
mHeaders.insert( QStringLiteral( "Authorization" ),
|
||||||
QStringLiteral( "Bearer %1" ).arg( QString::fromStdString( tileAccessJson["accessToken"].get<std::string>() ) ) );
|
QStringLiteral( "Bearer %1" ).arg( QString::fromStdString( tileAccessJson["accessToken"].get<std::string>() ) ) );
|
||||||
|
}
|
||||||
mAuthCfg.clear();
|
mAuthCfg.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user