AnsweredAssumed Answered

I want to create basemap using my local tpk file in wpf app. How can i do it?

Question asked by VanyaIvanov on Sep 24, 2020
Latest reply on Oct 1, 2020 by jerembzh56

I've found some code for Map case: 

 

Map myMap = new Map();

String filepath = "location_of_raster_file" ;

Raster myRasterFile = new Raster(filepath);


RasterLayer myRasterLayer = new RasterLayer(myRasterFile);
await myRasterLayer.LoadAsync();

myMap.Basemap.BaseLayers.Add(myRasterLayer);

 

 

But it doesn't work for Scene:

 

Scene newScene = new Scene();

String filepath = "C:\\Users\\user\\Desktop\\City.tpk";

Raster myRasterFile = new Raster(filepath);


RasterLayer myRasterLayer = new RasterLayer(myRasterFile);
await myRasterLayer.LoadAsync();

newScene.Basemap.BaseLayers.Add(myRasterLayer);

Outcomes