Using Raster file as baselayer in basemap and not use online basemap or offline map packs.

1009
4
03-07-2018 02:00 PM
BikeshMaharjan1
New Contributor III

Can we just use raster file as baselayer in basemap instead of online or offline basemaps(topo, imagery) and still add graphics in graphics overlay of mymapview and do geometry operation on those graphics(GeometryEngine)? 

Thanks!

4 Replies
AnttiKajanus1
Occasional Contributor III

Yes you can. Please have a look into arcgis-runtime-samples-dotnet/src/WPF/ArcGISRuntime.WPF.Samples/Samples/Layers/RasterLayerFile at ma...  sample. Instead of creating a basemap from imagery, pass in the raster layer to the map. 

BikeshMaharjan1
New Contributor III

Thank you for the information. However, The code still uses imagery basemap which needs online access.

Map myMap = new Map(Basemap.CreateImagery());
0 Kudos
NagmaYasmin
Occasional Contributor III

Here is the code that uses a local raster layer as a basemap.

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);

Hope that helps.

VanyaIvanov
Occasional Contributor

Thank you. Does the same should work when using Scene instead of Map?

0 Kudos