cesium-native 0.52.0
Loading...
Searching...
No Matches
GoogleMapTilesRasterOverlay.h
1#pragma once
2
3#include <CesiumRasterOverlays/Library.h>
4#include <CesiumRasterOverlays/RasterOverlay.h>
5#include <CesiumUtility/JsonValue.h>
6
7#include <optional>
8#include <string>
9
10namespace CesiumRasterOverlays {
11
19 std::string key;
20
24 std::string session;
25
33 std::string expiry;
34
38 uint32_t tileWidth;
39
43 uint32_t tileHeight;
44
49 std::string imageFormat;
50
58 bool showLogo = true;
59
63 std::string apiBaseUrl{"https://tile.googleapis.com/"};
64};
65
73 inline static const std::string roadmap = "roadmap";
74
78 inline static const std::string satellite = "satellite";
79
85 inline static const std::string terrain = "terrain";
86
91 inline static const std::string streetview = "streetview";
92};
93
104 inline static const std::string layerRoadmap = "layerRoadmap";
105
110 inline static const std::string layerStreetview = "layerStreetview";
111
115 inline static const std::string layerTraffic = "layerTraffic";
116};
117
126 inline static const std::string png = "png";
127
132 inline static const std::string jpeg = "jpeg";
133};
134
142 inline static const std::string scaleFactor1x = "scaleFactor1x";
143
147 inline static const std::string scaleFactor2x = "scaleFactor2x";
148
152 inline static const std::string scaleFactor4x = "scaleFactor4x";
153};
154
162 std::string key;
163
168 std::string mapType{"satellite"};
169
176 std::string language{"en-US"};
177
183 std::string region{"US"};
184
192 std::optional<std::string> imageFormat{};
193
202 std::optional<std::string> scale{};
203
219 std::optional<bool> highDpi{};
220
225 std::optional<std::vector<std::string>> layerTypes{};
226
237 std::optional<CesiumUtility::JsonValue::Array> styles{};
238
246 std::optional<bool> overlay{};
247
251 std::string apiBaseUrl{"https://tile.googleapis.com/"};
252};
253
258class CESIUMRASTEROVERLAYS_API GoogleMapTilesRasterOverlay
259 : public RasterOverlay {
260public:
270 const std::string& name,
271 const GoogleMapTilesNewSessionParameters& newSessionParameters,
272 const RasterOverlayOptions& overlayOptions = {});
273
283 const std::string& name,
284 const GoogleMapTilesExistingSession& existingSession,
285 const RasterOverlayOptions& overlayOptions = {});
286
289 const CesiumAsync::AsyncSystem& asyncSystem,
290 const std::shared_ptr<CesiumAsync::IAssetAccessor>& pAssetAccessor,
291 const std::shared_ptr<CesiumUtility::CreditSystem>& pCreditSystem,
292 const std::shared_ptr<IPrepareRasterOverlayRendererResources>&
293 pPrepareRendererResources,
294 const std::shared_ptr<spdlog::logger>& pLogger,
296 const override;
297
298private:
300 const CesiumAsync::AsyncSystem& asyncSystem,
301 const std::shared_ptr<CesiumAsync::IAssetAccessor>& pAssetAccessor,
302 const std::shared_ptr<CesiumUtility::CreditSystem>& pCreditSystem,
303 const std::shared_ptr<IPrepareRasterOverlayRendererResources>&
304 pPrepareRendererResources,
305 const std::shared_ptr<spdlog::logger>& pLogger,
307
308 std::optional<GoogleMapTilesNewSessionParameters> _newSessionParameters;
309 std::optional<GoogleMapTilesExistingSession> _existingSession;
310};
311
312} // 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 Future.h:29
GoogleMapTilesRasterOverlay(const std::string &name, const GoogleMapTilesNewSessionParameters &newSessionParameters, const RasterOverlayOptions &overlayOptions={})
Constructs a new overlay that will start a new Google Maps Tiles session with the specified parameter...
GoogleMapTilesRasterOverlay(const std::string &name, const GoogleMapTilesExistingSession &existingSession, const RasterOverlayOptions &overlayOptions={})
Constructs a new overlay that will use an existing Google Maps Tiles session that was previously star...
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
RasterOverlay(const std::string &name, const RasterOverlayOptions &overlayOptions=RasterOverlayOptions())
Creates a new instance.
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.
Holds the parameters for an existing Google Maps Tiles session.
uint32_t tileHeight
The height of the tiles measured in pixels.
std::string session
The session token value to include in all Map Tiles API requests.
std::string expiry
A string that contains the time (in seconds since the epoch) at which the token expires.
std::string key
The Google Map Tiles API key to use.
std::string apiBaseUrl
The base URL for the Google Maps Tiles API.
std::string imageFormat
The image format, which can be either GoogleMapTilesImageFormat::png or GoogleMapTilesImageFormat::jp...
uint32_t tileWidth
The width of the tiles measured in pixels.
bool showLogo
Whether or not the GoogleMapTilesRasterOverlay should show the Google Maps logo.
Standard values for GoogleMapTilesNewSessionParameters::imageFormat.
static const std::string jpeg
Joint Photographic Experts Group format. This format doesn't support transparency.
static const std::string png
Portable Network Graphics format. This format supports transparency.
Standard values for GoogleMapTilesNewSessionParameters::layerTypes.
static const std::string layerRoadmap
Required if you specify terrain as the map type. Can also be optionally overlaid on the satellite map...
static const std::string layerStreetview
Shows Street View-enabled streets and locations using blue outlines on the map.
static const std::string layerTraffic
Displays current traffic conditions.
Standard values for GoogleMapTilesNewSessionParameters::mapType.
static const std::string roadmap
The standard Google Maps painted map tiles.
static const std::string streetview
Street View panoramas. This is a documented map type supported by the service, but it is unlikely to ...
static const std::string satellite
Satellite imagery.
static const std::string terrain
Terrain imagery. When selecting terrain as the map type, you must also set the GoogleMapTilesNewSessi...
Holds the parameters for starting a new Google Maps Tiles session.
std::optional< std::string > imageFormat
Specifies the file format to return. See GoogleMapTilesImageFormat for standard values.
std::optional< CesiumUtility::JsonValue::Array > styles
An array of JSON style objects that specify the appearance and detail level of map features such as r...
std::string region
A Common Locale Data Repository region identifier (two uppercase letters) that represents the physica...
std::optional< std::vector< std::string > > layerTypes
An array of values that specifies the layer types added to the map. See GoogleMapTilesLayerType for s...
std::optional< bool > highDpi
Specifies whether to return high-resolution tiles.
std::optional< bool > overlay
A boolean value that specifies whether layerTypes should be rendered as a separate overlay,...
std::optional< std::string > scale
Scales-up the size of map elements (such as road labels), while retaining the tile size and coverage ...
std::string language
An IETF language tag that specifies the language used to display information on the tiles....
std::string apiBaseUrl
The base URL for the Google Maps Tiles API.
std::string mapType
The type of base map. See GoogleMapTilesMapType for standard values.
Standard values for GoogleMapTilesNewSessionParameters::scale.
static const std::string scaleFactor2x
Doubles label size and removes minor feature labels.
static const std::string scaleFactor1x
The default.
static const std::string scaleFactor4x
Quadruples label size and removes minor feature labels.
Options for loading raster overlays.