View on GitHub Sample viewer app

Show various kinds of 3D symbols in a scene.

Image of scene symbols

Use case

You can programmatically create different types of 3D symbols and add them to a scene at specified locations. You could do this to call attention to the prominence of a location.

How to use the sample

When the scene loads, note the different types of 3D symbols that you can create.

How it works

  1. Create a GraphicsOverlay.
  2. Create various simple marker scene symbols by specifying different styles and colors, and a height, width, depth, and anchor position of each.
  3. Create a new Graphic object for each symbol.
  4. Add the graphics to the graphics overlay with graphicsOverlay.getGraphics().add(graphic).
  5. Add the graphics overlay to the scene view with sceneView.getGraphicsOverlays().add(graphicsOverlay).

Relevant API

  • Graphic
  • GraphicsOverlay
  • SceneSymbol.AnchorPosition
  • SimpleMarkerSceneSymbol
  • SimpleMarkerSceneSymbol.Style

About the data

This sample shows arbitrary symbols in an empty scene with an imagery basemap.

Tags

3D, cone, cube, cylinder, diamond, geometry, pyramid, scene, shape, sphere, symbol, tetrahedron, tube, visualization

Sample Code

module-info.java module-info.java SymbolsSample.java
/*
* Copyright 2022 Esri.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
module com.esri.samples.symbols {
// require ArcGIS Maps SDK for Java module
requires com.esri.arcgisruntime;
// handle SLF4J http://www.slf4j.org/codes.html#StaticLoggerBinder
requires org.slf4j.nop;
// require JavaFX modules that the application uses
requires javafx.graphics;
exports com.esri.samples.symbols;
}