#pragma once #include "Library.h" #include "RasterOverlay.h" #include #include #include #include #include #include #include #include namespace CesiumRasterOverlays { /** * @brief Options for {@link WebMapTileServiceRasterOverlay}. */ struct WebMapTileServiceRasterOverlayOptions { /** * @brief The MIME type for images to retrieve from the server. * * Default value is "image/jpeg" */ std::optional format; /** * @brief The subdomains to use for the {s} placeholder in the URL template. * * If this parameter is a single string, each character in the string is a * subdomain. If it is an array, each element in the array is a subdomain. */ std::vector subdomains; /** * @brief A credit for the data source, which is displayed on the canvas. */ std::optional credit; /** * @brief The layer name for WMTS requests. */ std::string layer; /** * @brief The style name for WMTS requests. */ std::string style; /** * @brief The identifier of the TileMatrixSet to use for WMTS requests. */ std::string tileMatrixSetID; /** * @brief A list of identifiers in the TileMatrix to use for WMTS requests, * one per TileMatrix level. */ std::optional> tileMatrixLabels; /** * @brief The minimum level-of-detail supported by the imagery provider. * * Take care when specifying this that the number of tiles at the minimum * level is small, such as four or less. A larger number is likely to * result in rendering problems. * Default value is 0. */ std::optional minimumLevel; /** * @brief The maximum level-of-detail supported by the imagery provider. * * Default value is 25. */ std::optional maximumLevel; /** * @brief The {@link CesiumGeometry::Rectangle}, in radians, covered by the * image. */ std::optional coverageRectangle; /** * @brief The {@link CesiumGeospatial::Projection} that is used. */ std::optional projection; /** * @brief The {@link CesiumGeometry::QuadtreeTilingScheme} specifying how * the ellipsoidal surface is broken into tiles. */ std::optional tilingScheme; /** * @brief A object containing static dimensions and their values. */ std::optional> dimensions; /** * @brief Pixel width of image tiles. * * Default value is 256 */ std::optional tileWidth; /** * @brief Pixel height of image tiles. * * Default value is 256 */ std::optional tileHeight; }; /** * @brief A {@link RasterOverlay} accessing images from a Web Map Tile Service * (WMTS) server. */ class CESIUMRASTEROVERLAYS_API WebMapTileServiceRasterOverlay final : public RasterOverlay { public: /** * @brief Creates a new instance. * * @param name The user-given name of this overlay layer. * @param url The base URL. * @param headers The headers. This is a list of pairs of strings of the * form (Key,Value) that will be inserted as request headers internally. * @param tmsOptions The {@link WebMapTileServiceRasterOverlayOptions}. * @param overlayOptions The {@link RasterOverlayOptions} for this instance. */ WebMapTileServiceRasterOverlay( const std::string& name, const std::string& url, const std::vector& headers = {}, const WebMapTileServiceRasterOverlayOptions& tmsOptions = {}, const RasterOverlayOptions& overlayOptions = {}); virtual ~WebMapTileServiceRasterOverlay() override; virtual CesiumAsync::Future createTileProvider( const CesiumAsync::AsyncSystem& asyncSystem, const std::shared_ptr& pAssetAccessor, const std::shared_ptr& pCreditSystem, const std::shared_ptr& pPrepareRendererResources, const std::shared_ptr& pLogger, CesiumUtility::IntrusivePointer pOwner) const override; private: std::string _url; std::vector _headers; WebMapTileServiceRasterOverlayOptions _options; }; } // namespace CesiumRasterOverlays