How to display a sceneView with white BackGround ?

997
4
07-19-2017 05:32 AM
ManelKEDDAR
New Contributor III

Hello  every one ,

I need to display a 3D featureLayers so i need to use a sceneView but need to display just the 3D featureLayers so the basemap needs to be white how i can do that ? i've tried on the .xaml to put Background="white" and i still have the   terrestrial globule i don't want to display it .Any one hep thanks in advanced

cheers

0 Kudos
4 Replies
dotMorten_esri
Esri Notable Contributor

Try setting the background grid and lines of the surface to white:

sceneView.Scene.BaseSurface.BackgroundGrid = new Esri.ArcGISRuntime.UI.BackgroundGrid(Colors.White, Colors.White, 0, 100f);

0 Kudos
ManelKEDDAR
New Contributor III

Thanks for your answer ;

It seems my question wasn't clear as much as i thought .

i have a feature layer that contains a 3D geometry . i need to display this Feature Layer on a sceneView so the geometry will be visible , i need to display just the gemetry don't want to have a neather a basemap nor the  terrestrial globe i 've tried the folowing code 

var mapService = new LocalFeatureService(@"C:\Users\mkeddar\Documents\ArcGIS\3Dservitude.mpk");
await mapService.StartAsync();
MyMapView.Map = new Map();
SceneView.Scene = new Scene();
MyMapView.Map.OperationalLayers.Add(new FeatureLayer(new Uri($"{mapService.Url}/1")));
SceneView.Scene.OperationalLayers.Add(new FeatureLayer(new Uri($"{mapService.Url}/0")));
SceneView.Scene.BaseSurface.BackgroundGrid = new Esri.ArcGISRuntime.UI.BackgroundGrid(Colors.White, Colors.White, 0, 100f);

but it doesn 't work .So i think i need to locate the featureLayer on a position and zoom the camera on this location .But this doesn't work with featureLayers it works only with  GraphicsOverlays

Any one have an idea about that 

thanks in advanced 

0 Kudos
dotMorten_esri
Esri Notable Contributor

The globe cannot be turned off, but it can be made white as demonstrated. 

Data in FeatureLayers are currently always placed flat on the ground. You will have to use GraphicsOverlays to get around this today, or use a SceneLayer pointing to a 3D service.

0 Kudos
ManelKEDDAR
New Contributor III

Hello Morten ,

Thanks for your answer , 

I actually changed the method and i used a (.lpk) to point on my 3D service i want to add my sceneLayer to a specific place and zoom the view on that point in order to visualize only the sceneLayer but still don't know how to do that .I mean how to add my sceneLayer on a specific location (Map Point) is there any way how to do that ?for using a 3D Service ,can i use localFeatureService ? Here's my sample code 

public MainWindow()
{
InitializeComponent();
MyMapView.Map = new Map();

SceneView.Scene = new Scene();
StartupLocalServer();
StartupLocalServer();
}

// Map initialization logic is contained in MapViewModel.cs
private async void StartupLocalServer()
{

var mapService = new LocalFeatureService(@"C:\Users\mkeddar\Documents\ArcGIS\3Dservitude.mpk");
var sceneService = new LocalFeatureService(@"C:\Users\mkeddar\Documents\ArcGIS\Geom3DServitudeGabarit.lpk");
var uri = new Uri(@"C:\Users\mkeddar\Documents\ArcGIS\Geom3DServitudeGabarit.lpk");

var elevationSource = new ArcGISTiledElevationSource(new System.Uri(@"C:\Users\mkeddar\Documents\ArcGIS\Geom3DServitudeGabarit.lpk"));
var sceneSurface = new Surface();
sceneSurface.ElevationSources.Add(elevationSource);
SceneView.Scene.BaseSurface = sceneSurface;
var sceneGraphicsOverLays = new GraphicsOverlay();
SceneView.GraphicsOverlays.Add(sceneGraphicsOverLays);
await mapService.StartAsync();


// MyMapView.GeoViewTapped += MymapView_GeoViewTapped;

var featureTable2DUri = new System.Uri($"{mapService.Url}/1");
var featureTable = new ServiceFeatureTable(featureTable2DUri);
await featureTable.LoadAsync();

// if the table was loaded successfully, create a new feature layer for the table and add it to the map
if (featureTable.LoadStatus == Esri.ArcGISRuntime.LoadStatus.Loaded)
{
var lyr = new FeatureLayer(featureTable);
MyMapView.Map.OperationalLayers.Add(lyr);
}

//visualisation 3D

var layer = new ArcGISSceneLayer();

layer.Source = new Uri($"{sceneService.Url}/0");
// await layer.LoadAsync();
SceneView.Scene.OperationalLayers.Add(layer);
SceneView.Scene.BaseSurface.BackgroundGrid = new Esri.ArcGISRuntime.UI.BackgroundGrid(Colors.White, Colors.White, 0, 100f);

}

and i have a problem when i start the sceneService it doesn't start is there any solution for that ? thanks in advanced 

0 Kudos