From 50d1ba0baa07c52d1fea62c8b7f4ba85fe7aaa41 Mon Sep 17 00:00:00 2001 From: Janine Liu Date: Mon, 13 Oct 2025 15:31:16 -0400 Subject: [PATCH 1/7] Add CesiumAzureMapsRasterOverlay [skip ci] --- .../Private/CesiumAzureMapsRasterOverlay.cpp | 47 ++++++++ .../Public/CesiumAzureMapsRasterOverlay.h | 102 ++++++++++++++++++ extern/cesium-native | 2 +- 3 files changed, 150 insertions(+), 1 deletion(-) create mode 100644 Source/CesiumRuntime/Private/CesiumAzureMapsRasterOverlay.cpp create mode 100644 Source/CesiumRuntime/Public/CesiumAzureMapsRasterOverlay.h diff --git a/Source/CesiumRuntime/Private/CesiumAzureMapsRasterOverlay.cpp b/Source/CesiumRuntime/Private/CesiumAzureMapsRasterOverlay.cpp new file mode 100644 index 000000000..84b89a60d --- /dev/null +++ b/Source/CesiumRuntime/Private/CesiumAzureMapsRasterOverlay.cpp @@ -0,0 +1,47 @@ +// Copyright 2020-2025 CesiumGS, Inc. and Contributors + +#include "CesiumAzureMapsRasterOverlay.h" +#include "Cesium3DTilesSelection/Tileset.h" +#include "CesiumRasterOverlays/AzureMapsRasterOverlay.h" + +using namespace CesiumRasterOverlays; + +namespace { +std::string getTilesetId(EAzureMapsTilesetId tilesetId) { + switch (tilesetId) { + case EAzureMapsTilesetId::BaseDarkGrey: + return AzureMapsTilesetId::baseDarkGrey; + case EAzureMapsTilesetId::BaseLabelsRoad: + return AzureMapsTilesetId::baseLabelsRoad; + case EAzureMapsTilesetId::BaseLabelsDarkGrey: + return AzureMapsTilesetId::baseLabelsDarkGrey; + case EAzureMapsTilesetId::Imagery: + return AzureMapsTilesetId::imagery; + case EAzureMapsTilesetId::Terra: + return AzureMapsTilesetId::terra; + case EAzureMapsTilesetId::BaseRoad: + default: + return AzureMapsTilesetId::baseRoad; + } +} +} // namespace + +std::unique_ptr +UCesiumAzureMapsRasterOverlay::CreateOverlay( + const CesiumRasterOverlays::RasterOverlayOptions& options) { + if (this->Key.IsEmpty()) { + // We must have a key to create this overlay. + return nullptr; + } + + return std::make_unique( + TCHAR_TO_UTF8(*this->MaterialLayerKey), + AzureMapsSessionParameters{ + .key = TCHAR_TO_UTF8(*this->Key), + .apiVersion = TCHAR_TO_UTF8(*this->ApiVersion), + .tilesetId = getTilesetId(this->TilesetId), + .language = TCHAR_TO_UTF8(*this->Language), + .view = TCHAR_TO_UTF8(*this->View), + }, + options); +} diff --git a/Source/CesiumRuntime/Public/CesiumAzureMapsRasterOverlay.h b/Source/CesiumRuntime/Public/CesiumAzureMapsRasterOverlay.h new file mode 100644 index 000000000..dc2ec4140 --- /dev/null +++ b/Source/CesiumRuntime/Public/CesiumAzureMapsRasterOverlay.h @@ -0,0 +1,102 @@ +// Copyright 2020-2025 CesiumGS, Inc. and Contributors + +#pragma once + +#include "CesiumRasterOverlay.h" +#include "CoreMinimal.h" +#include "CesiumAzureMapsRasterOverlay.generated.h" + +/** + * Supported values for the `TilesetId` property. + */ +UENUM(BlueprintType) +enum class EAzureMapsTilesetId : uint8 { + /** + * @brief All layers with Azure Maps' main style. + */ + BaseRoad UMETA(DisplayName = "Base"), + /** + * @brief All layers with Azure Maps' dark grey style. + */ + BaseDarkGrey, + /** + * @brief Label data in Azure Maps' main style. + */ + BaseLabelsRoad, + /** + * @brief Label data in Azure Maps' dark grey style. + */ + BaseLabelsDarkGrey, + /** + * @brief A combination of satellite or aerial imagery. Only available in S1 + * and G2 pricing SKU. + */ + Imagery, + /** + * @brief Shaded relief and terra layers. + */ + Terra, +}; + +/** + * A raster overlay that directly accesses Azure Maps. If you're using Azure + * Maps via Cesium ion, use the "Cesium ion Raster Overlay" component instead. + */ +UCLASS(ClassGroup = Cesium, meta = (BlueprintSpawnableComponent)) +class CESIUMRUNTIME_API UCesiumAzureMapsRasterOverlay + : public UCesiumRasterOverlay { + GENERATED_BODY() + +public: + /** + * The Azure Maps subscription key to use. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cesium") + FString Key; + + /** + * The version number of Azure Maps API. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cesium") + FString ApiVersion = "2024-04-01"; + + /** + * The tileset ID to use. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cesium") + EAzureMapsTilesetId TilesetId = EAzureMapsTilesetId::Imagery; + + /** + * The language in which search results should be returned. This should be one + * of the supported IETF language tags, case insensitive. When data in the + * specified language is not available for a specific field, default language + * is used. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cesium") + FString Language = "en-US"; + + /** + * The View parameter (also called the "user region" parameter) allows + * you to show the correct maps for a certain country/region for + * geopolitically disputed regions. + * + * Different countries/regions have different views of such regions, and the + * View parameter allows your application to comply with the view required by + * the country/region your application will be serving. By default, the View + * parameter is set to "Unified" even if you haven't defined it in the + * request. It is your responsibility to determine the location of your users, + * and then set the View parameter correctly for that location. Alternatively, + * you have the option to set 'View=Auto', which will return the map data + * based on the IP address of the request. The View parameter in Azure Maps + * must be used in compliance with applicable laws, including those regarding + * mapping, of the country/region where maps, images and other data and third + * party content that you are authorized to access via Azure Maps is made + * available. Example: view=IN. + */ + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cesium") + FString View = "US"; + +protected: + virtual std::unique_ptr CreateOverlay( + const CesiumRasterOverlays::RasterOverlayOptions& options = {}) override; +}; diff --git a/extern/cesium-native b/extern/cesium-native index 126a412a7..05502dd87 160000 --- a/extern/cesium-native +++ b/extern/cesium-native @@ -1 +1 @@ -Subproject commit 126a412a791dd596c5ed81c05ef2443339c64ff8 +Subproject commit 05502dd87b2279f2848f52a7eacfc18c80e0aa9c From f74db25b2d3dba7d72b37e7e8b6ff27763404bcf Mon Sep 17 00:00:00 2001 From: Janine Liu Date: Tue, 14 Oct 2025 13:46:56 -0400 Subject: [PATCH 2/7] Working Azure Maps overlay --- .../Public/CesiumAzureMapsRasterOverlay.h | 18 +++++++++--------- extern/cesium-native | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Source/CesiumRuntime/Public/CesiumAzureMapsRasterOverlay.h b/Source/CesiumRuntime/Public/CesiumAzureMapsRasterOverlay.h index dc2ec4140..b7d3c5697 100644 --- a/Source/CesiumRuntime/Public/CesiumAzureMapsRasterOverlay.h +++ b/Source/CesiumRuntime/Public/CesiumAzureMapsRasterOverlay.h @@ -12,30 +12,30 @@ UENUM(BlueprintType) enum class EAzureMapsTilesetId : uint8 { /** - * @brief All layers with Azure Maps' main style. + * All roadmap layers with Azure Maps' main style. */ - BaseRoad UMETA(DisplayName = "Base"), + BaseRoad UMETA(DisplayName = "Roadmap"), /** - * @brief All layers with Azure Maps' dark grey style. + * @brief All roadmap layers with Azure Maps' dark grey style. */ - BaseDarkGrey, + BaseDarkGrey UMETA(DisplayName = "Roadmap (Dark Grey)"), /** * @brief Label data in Azure Maps' main style. */ - BaseLabelsRoad, + BaseLabelsRoad UMETA(DisplayName = "Labels"), /** * @brief Label data in Azure Maps' dark grey style. */ - BaseLabelsDarkGrey, + BaseLabelsDarkGrey UMETA(DisplayName = "Labels (Dark Grey)"), /** * @brief A combination of satellite or aerial imagery. Only available in S1 * and G2 pricing SKU. */ Imagery, /** - * @brief Shaded relief and terra layers. + * Shaded relief and terra layers. */ - Terra, + Terra }; /** @@ -64,7 +64,7 @@ class CESIUMRUNTIME_API UCesiumAzureMapsRasterOverlay * The tileset ID to use. */ UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Cesium") - EAzureMapsTilesetId TilesetId = EAzureMapsTilesetId::Imagery; + EAzureMapsTilesetId TilesetId = EAzureMapsTilesetId::BaseRoad; /** * The language in which search results should be returned. This should be one diff --git a/extern/cesium-native b/extern/cesium-native index 05502dd87..d8631d0a6 160000 --- a/extern/cesium-native +++ b/extern/cesium-native @@ -1 +1 @@ -Subproject commit 05502dd87b2279f2848f52a7eacfc18c80e0aa9c +Subproject commit d8631d0a6d94757416c6dbf0dc069e93f14140e8 From 8fcd32a5121487c4db0a9fd57c22b303f4ed5734 Mon Sep 17 00:00:00 2001 From: Janine Liu Date: Wed, 15 Oct 2025 17:48:18 -0400 Subject: [PATCH 3/7] Add missing tilesetId options, fix empty credit bug --- CHANGES.md | 10 ++++ .../Private/CesiumAzureMapsRasterOverlay.cpp | 18 ++++++ .../Private/CesiumCreditSystem.cpp | 16 +++-- .../Public/CesiumAzureMapsRasterOverlay.h | 60 ++++++++++++++++--- .../Public/CesiumRasterOverlay.h | 2 +- extern/cesium-native | 2 +- 6 files changed, 92 insertions(+), 16 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 4c2eda899..265f45911 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,15 @@ # Change Log {#changes} +### ? - ? + +##### Additions :tada: + +- Added `CesiumAzureMapsRasterOverlay`. + +##### Fixes :wrench: + +- Fixed a bug where `CesiumCreditSystem` would not filter out empty credits, resulting in duplicate on-screen delimiters. + ### v2.20.0 - 2025-10-01 ##### Additions :tada: diff --git a/Source/CesiumRuntime/Private/CesiumAzureMapsRasterOverlay.cpp b/Source/CesiumRuntime/Private/CesiumAzureMapsRasterOverlay.cpp index 84b89a60d..3389549e0 100644 --- a/Source/CesiumRuntime/Private/CesiumAzureMapsRasterOverlay.cpp +++ b/Source/CesiumRuntime/Private/CesiumAzureMapsRasterOverlay.cpp @@ -15,10 +15,28 @@ std::string getTilesetId(EAzureMapsTilesetId tilesetId) { return AzureMapsTilesetId::baseLabelsRoad; case EAzureMapsTilesetId::BaseLabelsDarkGrey: return AzureMapsTilesetId::baseLabelsDarkGrey; + case EAzureMapsTilesetId::BaseHybridRoad: + return AzureMapsTilesetId::baseHybridRoad; + case EAzureMapsTilesetId::BaseHybridDarkGrey: + return AzureMapsTilesetId::baseHybridDarkGrey; case EAzureMapsTilesetId::Imagery: return AzureMapsTilesetId::imagery; case EAzureMapsTilesetId::Terra: return AzureMapsTilesetId::terra; + case EAzureMapsTilesetId::WeatherRadar: + return AzureMapsTilesetId::weatherRadar; + case EAzureMapsTilesetId::WeatherInfrared: + return AzureMapsTilesetId::weatherInfrared; + case EAzureMapsTilesetId::TrafficAbsolute: + return AzureMapsTilesetId::trafficAbsolute; + case EAzureMapsTilesetId::TrafficRelativeMain: + return AzureMapsTilesetId::trafficRelativeMain; + case EAzureMapsTilesetId::TrafficRelativeDark: + return AzureMapsTilesetId::trafficRelativeDark; + case EAzureMapsTilesetId::TrafficDelay: + return AzureMapsTilesetId::trafficDelay; + case EAzureMapsTilesetId::TrafficReduced: + return AzureMapsTilesetId::trafficReduced; case EAzureMapsTilesetId::BaseRoad: default: return AzureMapsTilesetId::baseRoad; diff --git a/Source/CesiumRuntime/Private/CesiumCreditSystem.cpp b/Source/CesiumRuntime/Private/CesiumCreditSystem.cpp index 88797f280..bbb747b42 100644 --- a/Source/CesiumRuntime/Private/CesiumCreditSystem.cpp +++ b/Source/CesiumRuntime/Private/CesiumCreditSystem.cpp @@ -340,15 +340,19 @@ void ACesiumCreditSystem::Tick(float DeltaTime) { for (int i = 0; i < creditsToShowThisFrame.size(); i++) { const CesiumUtility::Credit& credit = creditsToShowThisFrame[i]; - FString CreditRtf; + FString creditRtf; const std::string& html = _pCreditSystem->getHtml(credit); auto htmlFind = _htmlToRtf.find(html); if (htmlFind != _htmlToRtf.end()) { - CreditRtf = htmlFind->second; + creditRtf = htmlFind->second; } else { - CreditRtf = ConvertHtmlToRtf(html); - _htmlToRtf.insert({html, CreditRtf}); + creditRtf = ConvertHtmlToRtf(html); + _htmlToRtf.insert({html, creditRtf}); + } + + if (creditRtf.IsEmpty()) { + continue; } if (_pCreditSystem->shouldBeShownOnScreen(credit)) { @@ -358,13 +362,13 @@ void ACesiumCreditSystem::Tick(float DeltaTime) { OnScreenCredits += TEXT(" \u2022 "); } - OnScreenCredits += CreditRtf; + OnScreenCredits += creditRtf; } else { if (i != 0) { Credits += "\n"; } - Credits += CreditRtf; + Credits += creditRtf; } } diff --git a/Source/CesiumRuntime/Public/CesiumAzureMapsRasterOverlay.h b/Source/CesiumRuntime/Public/CesiumAzureMapsRasterOverlay.h index b7d3c5697..c43e70505 100644 --- a/Source/CesiumRuntime/Public/CesiumAzureMapsRasterOverlay.h +++ b/Source/CesiumRuntime/Public/CesiumAzureMapsRasterOverlay.h @@ -14,28 +14,72 @@ enum class EAzureMapsTilesetId : uint8 { /** * All roadmap layers with Azure Maps' main style. */ - BaseRoad UMETA(DisplayName = "Roadmap"), + BaseRoad UMETA(DisplayName = "Base"), /** - * @brief All roadmap layers with Azure Maps' dark grey style. + * All roadmap layers with Azure Maps' dark grey style. */ - BaseDarkGrey UMETA(DisplayName = "Roadmap (Dark Grey)"), + BaseDarkGrey UMETA(DisplayName = "Base (Dark Grey)"), /** - * @brief Label data in Azure Maps' main style. + * Label data in Azure Maps' main style. */ BaseLabelsRoad UMETA(DisplayName = "Labels"), /** - * @brief Label data in Azure Maps' dark grey style. + * Label data in Azure Maps' dark grey style. */ BaseLabelsDarkGrey UMETA(DisplayName = "Labels (Dark Grey)"), /** - * @brief A combination of satellite or aerial imagery. Only available in S1 - * and G2 pricing SKU. + * Road, boundary, and label data in Azure Maps' main style. + */ + BaseHybridRoad UMETA(DisplayName = "Hybrid"), + /** + * Road, boundary, and label data in Azure Maps' dark grey style. + */ + BaseHybridDarkGrey UMETA(DisplayName = "Hybrid (Dark Grey)"), + /** + * A combination of satellite or aerial imagery. Only available for accounts + * under S1 and G2 pricing SKU. */ Imagery, /** * Shaded relief and terra layers. */ - Terra + Terra, + /** + * Weather radar tiles. Latest weather radar images including areas of rain, + * snow, ice and mixed conditions. + */ + WeatherRadar UMETA(DisplayName = "Weather (Radar)"), + /** + * Weather infrared tiles. Latest infrared satellite images showing clouds by + * their temperature. + */ + WeatherInfrared UMETA(DisplayName = "Weather (Infrared)"), + /** + * Absolute traffic tiles in Azure Maps' main style. + */ + TrafficAbsolute UMETA(DisplayName = "Traffic (Absolute)"), + /** + * Relative traffic tiles in Azure Maps' main style. This filters out traffic + * data from smaller streets that are otherwise included in TrafficAbsolute. + */ + TrafficRelativeMain UMETA(DisplayName = "Traffic (Relative)"), + /** + * Relative traffic tiles in Azure Maps' dark style. This filters out traffic + * data from smaller streets that are otherwise included in TrafficAbsolute. + */ + TrafficRelativeDark UMETA(DisplayName = "Traffic (Relative, Dark)"), + /** + * Delay traffic tiles in Azure Maps' dark style. This only shows the points + * of delay along traffic routes that are otherwise included in + * TrafficAbsolute. + */ + TrafficDelay UMETA(DisplayName = "Traffic (Delay)"), + /** + * Reduced traffic tiles in Azure Maps' dark style. This only shows the + * traffic routes without the delay points that are otherwise included in + * TrafficAbsolute. + */ + TrafficReduced UMETA(DisplayName = "Traffic (Reduced)"), }; /** diff --git a/Source/CesiumRuntime/Public/CesiumRasterOverlay.h b/Source/CesiumRuntime/Public/CesiumRasterOverlay.h index 8cd5f7544..601c273c9 100644 --- a/Source/CesiumRuntime/Public/CesiumRasterOverlay.h +++ b/Source/CesiumRuntime/Public/CesiumRasterOverlay.h @@ -111,7 +111,7 @@ class CESIUMRUNTIME_API UCesiumRasterOverlay : public UActorComponent { * overlay will be removed from the Cesium3DTileset if already present but not * re-added. */ - UFUNCTION(BlueprintCallable, Category = "Cesium") + UFUNCTION(CallInEditor, BlueprintCallable, Category = "Cesium") void Refresh(); UFUNCTION(BlueprintCallable, Category = "Cesium") diff --git a/extern/cesium-native b/extern/cesium-native index d8631d0a6..63f135345 160000 --- a/extern/cesium-native +++ b/extern/cesium-native @@ -1 +1 @@ -Subproject commit d8631d0a6d94757416c6dbf0dc069e93f14140e8 +Subproject commit 63f1353457c693a3f3195721fd4a43415bccb5e9 From 856b16082f3f58d41e9a86b7b96b5a12ef343b97 Mon Sep 17 00:00:00 2001 From: Janine Liu Date: Wed, 15 Oct 2025 18:12:26 -0400 Subject: [PATCH 4/7] Update native, tweak doc comment --- Source/CesiumRuntime/Public/CesiumAzureMapsRasterOverlay.h | 6 +++--- extern/cesium-native | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/CesiumRuntime/Public/CesiumAzureMapsRasterOverlay.h b/Source/CesiumRuntime/Public/CesiumAzureMapsRasterOverlay.h index c43e70505..c95be41ca 100644 --- a/Source/CesiumRuntime/Public/CesiumAzureMapsRasterOverlay.h +++ b/Source/CesiumRuntime/Public/CesiumAzureMapsRasterOverlay.h @@ -75,9 +75,9 @@ enum class EAzureMapsTilesetId : uint8 { */ TrafficDelay UMETA(DisplayName = "Traffic (Delay)"), /** - * Reduced traffic tiles in Azure Maps' dark style. This only shows the - * traffic routes without the delay points that are otherwise included in - * TrafficAbsolute. + * Reduced traffic tiles in Azure Maps' dark style. This shows the traffic + * routes and major delay points, but filters out some data that is otherwise + * included in TrafficAbsolute. */ TrafficReduced UMETA(DisplayName = "Traffic (Reduced)"), }; diff --git a/extern/cesium-native b/extern/cesium-native index 63f135345..7016cdf1b 160000 --- a/extern/cesium-native +++ b/extern/cesium-native @@ -1 +1 @@ -Subproject commit 63f1353457c693a3f3195721fd4a43415bccb5e9 +Subproject commit 7016cdf1b3677c5181a99e7b43005687dd7f0087 From 5ef1d5c5ff30aad487e9e4d121444b5b7f681af6 Mon Sep 17 00:00:00 2001 From: Janine Liu Date: Mon, 20 Oct 2025 11:03:58 -0400 Subject: [PATCH 5/7] Fix include style --- .../Private/CesiumAzureMapsRasterOverlay.cpp | 4 ++-- .../Private/CesiumGoogleMapTilesRasterOverlay.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Source/CesiumRuntime/Private/CesiumAzureMapsRasterOverlay.cpp b/Source/CesiumRuntime/Private/CesiumAzureMapsRasterOverlay.cpp index 3389549e0..6928208a0 100644 --- a/Source/CesiumRuntime/Private/CesiumAzureMapsRasterOverlay.cpp +++ b/Source/CesiumRuntime/Private/CesiumAzureMapsRasterOverlay.cpp @@ -1,8 +1,8 @@ // Copyright 2020-2025 CesiumGS, Inc. and Contributors #include "CesiumAzureMapsRasterOverlay.h" -#include "Cesium3DTilesSelection/Tileset.h" -#include "CesiumRasterOverlays/AzureMapsRasterOverlay.h" +#include +#include using namespace CesiumRasterOverlays; diff --git a/Source/CesiumRuntime/Private/CesiumGoogleMapTilesRasterOverlay.cpp b/Source/CesiumRuntime/Private/CesiumGoogleMapTilesRasterOverlay.cpp index 3d60293b8..3a690f565 100644 --- a/Source/CesiumRuntime/Private/CesiumGoogleMapTilesRasterOverlay.cpp +++ b/Source/CesiumRuntime/Private/CesiumGoogleMapTilesRasterOverlay.cpp @@ -1,10 +1,10 @@ // Copyright 2020-2025 CesiumGS, Inc. and Contributors #include "CesiumGoogleMapTilesRasterOverlay.h" -#include "Cesium3DTilesSelection/Tileset.h" -#include "CesiumJsonReader/JsonObjectJsonHandler.h" -#include "CesiumJsonReader/JsonReader.h" -#include "CesiumRasterOverlays/GoogleMapTilesRasterOverlay.h" +#include +#include +#include +#include using namespace CesiumJsonReader; using namespace CesiumRasterOverlays; From e82c5e9a4993da1b5e592748b4b30f02bae53ae6 Mon Sep 17 00:00:00 2001 From: Janine Liu Date: Mon, 20 Oct 2025 11:05:57 -0400 Subject: [PATCH 6/7] Update native --- extern/cesium-native | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extern/cesium-native b/extern/cesium-native index 7016cdf1b..7dc335dcf 160000 --- a/extern/cesium-native +++ b/extern/cesium-native @@ -1 +1 @@ -Subproject commit 7016cdf1b3677c5181a99e7b43005687dd7f0087 +Subproject commit 7dc335dcf8957ebec6ebba353f55949ab1798e84 From b3bbf96cfcf1887b5544490913c37fc90fd5ceb2 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Tue, 21 Oct 2025 09:59:22 +1100 Subject: [PATCH 7/7] Update native. --- extern/cesium-native | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extern/cesium-native b/extern/cesium-native index 7dc335dcf..aa5646dbf 160000 --- a/extern/cesium-native +++ b/extern/cesium-native @@ -1 +1 @@ -Subproject commit 7dc335dcf8957ebec6ebba353f55949ab1798e84 +Subproject commit aa5646dbf58d6cf8164b2e7a5e09c120184beba1