cesium-native 0.43.0
Loading...
Searching...
No Matches
IonRasterOverlay.h
1#pragma once
2
3#include "Library.h"
4#include "RasterOverlay.h"
5
6#include <CesiumAsync/IAssetRequest.h>
7#include <CesiumGeospatial/Ellipsoid.h>
8
9#include <functional>
10#include <memory>
11
12namespace CesiumRasterOverlays {
13
17class CESIUMRASTEROVERLAYS_API IonRasterOverlay final : public RasterOverlay {
18public:
34 const std::string& name,
35 int64_t ionAssetID,
36 const std::string& ionAccessToken,
37 const RasterOverlayOptions& overlayOptions = {},
38 const std::string& ionAssetEndpointUrl = "https://api.cesium.com/");
39 virtual ~IonRasterOverlay() override;
40
42 const CesiumAsync::AsyncSystem& asyncSystem,
43 const std::shared_ptr<CesiumAsync::IAssetAccessor>& pAssetAccessor,
44 const std::shared_ptr<CesiumUtility::CreditSystem>& pCreditSystem,
45 const std::shared_ptr<IPrepareRasterOverlayRendererResources>&
46 pPrepareRendererResources,
47 const std::shared_ptr<spdlog::logger>& pLogger,
49 const override;
50
51private:
52 int64_t _ionAssetID;
53 std::string _ionAccessToken;
54 std::string _ionAssetEndpointUrl;
55
56 struct AssetEndpointAttribution {
57 std::string html;
58 bool collapsible = true;
59 };
60
61 struct ExternalAssetEndpoint {
62 std::string externalType;
63 std::string url;
64 std::string mapStyle;
65 std::string key;
66 std::string culture;
67 std::string accessToken;
68 std::vector<AssetEndpointAttribution> attributions;
69 };
70
71 static std::unordered_map<std::string, ExternalAssetEndpoint> endpointCache;
72
74 const ExternalAssetEndpoint& endpoint,
75 const CesiumAsync::AsyncSystem& asyncSystem,
76 const std::shared_ptr<CesiumAsync::IAssetAccessor>& pAssetAccessor,
77 const std::shared_ptr<CesiumUtility::CreditSystem>& pCreditSystem,
78 const std::shared_ptr<IPrepareRasterOverlayRendererResources>&
79 pPrepareRendererResources,
80 const std::shared_ptr<spdlog::logger>& pLogger,
82};
83
84} // namespace CesiumRasterOverlays
A system for managing asynchronous requests and tasks.
Definition AsyncSystem.h:36
A value that will be available in the future, as produced by AsyncSystem.
Definition Promise.h:11
A RasterOverlay that obtains imagery data from Cesium ion.
IonRasterOverlay(const std::string &name, int64_t ionAssetID, const std::string &ionAccessToken, const RasterOverlayOptions &overlayOptions={}, const std::string &ionAssetEndpointUrl="https://api.cesium.com/")
Creates a new instance.
virtual CesiumAsync::Future< CreateTileProviderResult > createTileProvider(const CesiumAsync::AsyncSystem &asyncSystem, const std::shared_ptr< CesiumAsync::IAssetAccessor > &pAssetAccessor, const std::shared_ptr< CesiumUtility::CreditSystem > &pCreditSystem, const std::shared_ptr< IPrepareRasterOverlayRendererResources > &pPrepareRendererResources, const std::shared_ptr< spdlog::logger > &pLogger, CesiumUtility::IntrusivePointer< const RasterOverlay > pOwner) const override
Begins asynchronous creation of a tile provider for this overlay and eventually returns it via a Futu...
The base class for a rasterized image that can be draped over a Cesium3DTilesSelection::Tileset....
A smart pointer that calls addReference and releaseReference on the controlled object.
Classes for raster overlays, which allow draping massive 2D textures over a model.
Options for loading raster overlays.