Hello, everyone. When I was loading the local slpk file, there was a flash back phenomenon. Please advise me. Here is my code:
SceneView sceneView;
// set the title and size of the stage and show it
Stage stage=new Stage();
stage.setTitle("Display a scene tutorial");
stage.setWidth(800);
stage.setHeight(700);
stage.show();
// create a JavaFX scene with a stack pane as the root node, and add it to the scene
StackPane stackPane = new StackPane();
Scene fxScene = new Scene(stackPane);
stage.setScene(fxScene);
// Note: it is not best practice to store API keys in source code.
// The API key is referenced here for the convenience of this tutorial.
String yourApiKey = "AAPKe82436f57ac0479e84c38cd64354c2b7OJpYBvfcCaLME***********************";
ArcGISRuntimeEnvironment.setApiKey(yourApiKey);
// create a scene view to display the scene and add it to the stack pane
sceneView = new SceneView();
stackPane.getChildren().add(sceneView);
// set the scene on the scene view
sceneView.setArcGISScene(scene);
// add base surface for elevation data
Surface surface = new Surface();
String elevationServiceUrl = "https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer";
surface.getElevationSources().add(new ArcGISTiledElevationSource(elevationServiceUrl));
// add an exaggeration factor to increase the 3D effect of the elevation.
surface.setElevationExaggeration(2.5f);
scene.setBaseSurface(surface);
// add a point scene layer with points at world airport locations
// ArcGISSceneLayer pointSceneLayer = new ArcGISSceneLayer("https://tiles.arcgis.com/tiles/V6ZHFr6zdgNZuVG0/arcgis/rest/services/Airports_PointSceneLayer/SceneServer/layers/0");
// scene.getOperationalLayers().add(pointSceneLayer);
ArcGISSceneLayer sceneLayer = new ArcGISSceneLayer(slpkPath);
scene.getOperationalLayers().add(sceneLayer);
//Point cameraLocation = new Point(120.0734669, 31.9008889, 5330.0, SpatialReferences.getWgs84());
//Camera camera = new Camera(cameraLocation, 355.0, 72.0, 0.0);
Camera camera = new Camera(120.0734669,31.9008889, 50, 345, 65, 0);
sceneView.setViewpointCamera(camera);