-
Notifications
You must be signed in to change notification settings - Fork 332
Add CesiumAzureMapsRasterOverlay
#1750
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 5 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
50d1ba0
Add CesiumAzureMapsRasterOverlay [skip ci]
j9liu f74db25
Working Azure Maps overlay
j9liu 8fcd32a
Add missing tilesetId options, fix empty credit bug
j9liu 856b160
Update native, tweak doc comment
j9liu 894afa1
Merge branch 'main' into azure-overlay
j9liu fad42e8
Merge branch 'main' into azure-overlay
j9liu 5ef1d5c
Fix include style
j9liu e82c5e9
Update native
j9liu b3bbf96
Update native.
kring File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
Source/CesiumRuntime/Private/CesiumAzureMapsRasterOverlay.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| // 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::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; | ||
| } | ||
| } | ||
| } // namespace | ||
|
|
||
| std::unique_ptr<CesiumRasterOverlays::RasterOverlay> | ||
| 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<AzureMapsRasterOverlay>( | ||
| 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); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
146 changes: 146 additions & 0 deletions
146
Source/CesiumRuntime/Public/CesiumAzureMapsRasterOverlay.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,146 @@ | ||
| // 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 { | ||
| /** | ||
| * All roadmap layers with Azure Maps' main style. | ||
| */ | ||
| BaseRoad UMETA(DisplayName = "Base"), | ||
| /** | ||
| * All roadmap layers with Azure Maps' dark grey style. | ||
| */ | ||
| BaseDarkGrey UMETA(DisplayName = "Base (Dark Grey)"), | ||
| /** | ||
| * Label data in Azure Maps' main style. | ||
| */ | ||
| BaseLabelsRoad UMETA(DisplayName = "Labels"), | ||
| /** | ||
| * Label data in Azure Maps' dark grey style. | ||
| */ | ||
| BaseLabelsDarkGrey UMETA(DisplayName = "Labels (Dark Grey)"), | ||
| /** | ||
| * 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, | ||
| /** | ||
| * 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 shows the traffic | ||
| * routes and major delay points, but filters out some data that is otherwise | ||
| * included in TrafficAbsolute. | ||
| */ | ||
| TrafficReduced UMETA(DisplayName = "Traffic (Reduced)"), | ||
| }; | ||
|
|
||
| /** | ||
| * 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::BaseRoad; | ||
|
|
||
| /** | ||
| * 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<CesiumRasterOverlays::RasterOverlay> CreateOverlay( | ||
| const CesiumRasterOverlays::RasterOverlayOptions& options = {}) override; | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule cesium-native
updated
12 files
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.