@@ -66,6 +66,11 @@ CesiumAzureMapsRasterOverlayImpl::~CesiumAzureMapsRasterOverlayImpl() {}
6666void CesiumAzureMapsRasterOverlayImpl::AddToTileset (
6767 const ::DotNet::CesiumForUnity::CesiumAzureMapsRasterOverlay& overlay,
6868 const ::DotNet::CesiumForUnity::Cesium3DTileset& tileset) {
69+
70+ static bool debugMe = true ;
71+ if (debugMe) {
72+ return ;
73+ }
6974 if (this ->_pOverlay != nullptr ) {
7075 // Overlay already added.
7176 return ;
@@ -76,55 +81,21 @@ void CesiumAzureMapsRasterOverlayImpl::AddToTileset(
7681 return ;
7782 }
7883
84+ const CesiumForUnity::CesiumRasterOverlay& genericOverlay = overlay;
85+ auto options = CesiumRasterOverlayUtility::GetOverlayOptions (genericOverlay);
7986
80-
81- /*
82- Cesium3DTilesetImpl& tilesetImpl = tileset.NativeImplementation();
87+ auto & tilesetImpl = tileset.NativeImplementation ();
8388 Tileset* pTileset = tilesetImpl.getTileset ();
84- if (!pTileset)
85- return;
86- std::string mapStyle;
87- switch (overlay.mapStyle()) {
88- case CesiumForUnity::AzureMapsStyle::Aerial:
89- mapStyle = AzureMapsStyle::AERIAL;
90- break;
91- case CesiumForUnity::AzureMapsStyle::AerialWithLabelsOnDemand:
92- mapStyle = AzureMapsStyle::AERIAL_WITH_LABELS_ON_DEMAND;
93- break;
94- case CesiumForUnity::AzureMapsStyle::RoadOnDemand:
95- mapStyle = AzureMapsStyle::ROAD_ON_DEMAND;
96- break;
97- case CesiumForUnity::AzureMapsStyle::CanvasDark:
98- mapStyle = AzureMapsStyle::CANVAS_DARK;
99- break;
100- case CesiumForUnity::AzureMapsStyle::CanvasLight:
101- mapStyle = AzureMapsStyle::CANVAS_LIGHT;
102- break;
103- case CesiumForUnity::AzureMapsStyle::CanvasGray:
104- mapStyle = AzureMapsStyle::CANVAS_GRAY;
105- break;
106- case CesiumForUnity::AzureMapsStyle::OrdnanceSurvey:
107- mapStyle = AzureMapsStyle::ORDNANCE_SURVEY;
108- break;
109- case CesiumForUnity::AzureMapsStyle::CollinsBart:
110- mapStyle = AzureMapsStyle::COLLINS_BART;
111- break;
112- }
113-
114- CesiumForUnity::CesiumRasterOverlay genericOverlay = overlay;
115- RasterOverlayOptions options =
116- CesiumRasterOverlayUtility::GetOverlayOptions(genericOverlay);
117-
118- this->_pOverlay = new AzureMapsRasterOverlay(
119- overlay.materialKey().ToStlString(),
120- "https://dev.virtualearth.net",
121- overlay.AzureMapsKey().ToStlString(),
122- mapStyle,
123- "",
124- options);
125-
89+ AzureMapsSessionParameters sessionParameters {
90+ .key = overlay.key ().ToStlString (),
91+ .apiVersion = overlay.apiVersion ().ToStlString (),
92+ .tilesetId = getTilesetId (overlay.tilesetId ()),
93+ .language = overlay.language ().ToStlString (),
94+ .view = overlay.view ().ToStlString (),
95+ };
96+ this ->_pOverlay = new AzureMapsRasterOverlay (overlay.materialKey ().ToStlString (),
97+ sessionParameters, options);
12698 pTileset->getOverlays ().add (this ->_pOverlay );
127- */
12899}
129100
130101void CesiumAzureMapsRasterOverlayImpl::RemoveFromTileset (
0 commit comments