View on GitHub Sample viewer app

Change a graphic’s symbol based on the camera’s proximity to it.

Image of style point with distance composite scene symbol

Use case

When showing dense datasets, it is beneficial to reduce the detail of individual points when zooming out to avoid visual clutter and to avoid data points overlapping and obscuring each other.

How to use the sample

The sample starts looking at a plane. Zoom out from the plane to see it turn into a cone. Keeping zooming out and it will turn into a point.

How it works

  1. Create a GraphicsOverlay object and add it to a SceneView.
  2. Create a DistanceCompositeSceneSymbol object.
  3. Create DistanceSymbolRange objects specifying a Symbol and the min and max distance within which the symbol should be visible.
  4. Add the ranges to the range collection of the distance composite scene symbol.
  5. Create a Graphic object with the distance composite scene symbol at a location and add it to the graphics overlay.

Relevant API

  • DistanceCompositeSceneSymbol
  • DistanceSymbolRange
  • OrbitGeoElementCameraController

Tags

3D, data, graphic

Sample Code

DownloadActivity.kt DownloadActivity.kt MainActivity.kt StylePointWithDistanceCompositeSceneSymbolViewModel.kt StylePointWithDistanceCompositeSceneSymbolScreen.kt
/* Copyright 2025 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.
*
*/
package com.esri.arcgismaps.sample.stylepointwithdistancecompositescenesymbol
import android.content.Intent
import android.os.Bundle
import com.esri.arcgismaps.sample.sampleslib.DownloaderActivity
class DownloadActivity : DownloaderActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
downloadAndStartSample(
Intent(this, MainActivity::class.java),
getString(R.string.style_point_with_distance_composite_scene_symbol_app_name),
listOf(
"https://www.arcgis.com/home/item.html?id=681d6f7694644709a7c830ec57a2d72b"
)
)
}
}