How to access data services
CesiumJS applications can access data services hosted in ArcGIS. You can access data services to display features, image tiles, or 3D objects such as buildings. Supported data types include features, I3S data, and image tiles.
All data stored in ArcGIS is managed and accessed as a data service. You can create a data service by uploading your own data to ArcGIS. Data services are managed through an item and can be accessed in your application by referencing their service URL.
Feature data
If you have features containing geometry and attributes, you can import the data to create an ArcGIS feature layer in a feature service. To access the data, you can use the URL of the service to query and return features. You can style and display the results in a map or scene. Feature layers can also contain styling information as part of the service response.
How to access a feature service
To display features from a feature service in CesiumJS, you need to use ArcGIS REST JS to query the features and return results as GeoJSON. Once you have the GeoJSON response, use a Cesium Geo
to add and style the feature data.
Create a new feature service in ArcGIS Online or select an existing one. You can create a feature service by uploading a CSV, XLS, GeoJSON, or Shapefile.
In your CesiumJS application, add references to the ArcGIS REST JS
request
andfeature-service
packages.Create an
authentication
object with ArcGIS REST JS using your ArcGIS access token. If the feature service is private, ensure that your access token is properly scoped to access the features.Use
arcgis
to request features from the feature service. Set theRest.query Features url
parameter to the URL of the feature service, and includef:
to return results as GeoJSON."geojson" Create a new
Cesium.Geo
from the ArcGIS REST JS response.Json Data Source Add the GeoJSON data source to your scene using
data
.Sources.add
Example
Add a trailhead (points) layer
This example queries the Santa Monica Trailheads (points) feature layer and adds the results to the scene as a Geo
.
Scene data
A scene service contains 3D scene data stored in the Indexed 3D Scene Layer (I3S) format, an OGC standard. Cesium currently supports the following types of I3S layers:
How to access a scene service
To display scene data in CesiumJS, add an I3SData
to your app that references the URL of the scene service.
Create a scene service in ArcGIS by uploading a scene layer package, or find an existing scene layer from ArcGIS Living Atlas.
In your CesiumJS application, create a new
I3SData
. Set theProvider url
to the URL of the scene service.If your layer has gravity-related heights, set the
geoid
parameter of theTiled Terrain Provider I3SData
to an Earth Gravitational Model.Provider Add the I3S data provider to your scene using
scene.primitives.add
.
Example
Add a 3D object layer of San Francisco
This example displays a 3D object layer containing textured building models of San Francisco. It uses the Earth Gravitational Model EGM2008 to align buildings with terrain.
Image tile data
You can add an ArcGIS image tile service to a CesiumJS application to visualize your data. Image tile services can be accessed through the ArcGISMap
class.
How to access an image tile service
In ArcGIS, create an image tile service by publishing one from an existing feature layer, or by importing a tile package.
In your CesiumJS application, create a
Viewer
orCesium
.Widget Create a new
ArcGISMap
and set theServer Imagery Provider url
to the URL of the image tile service. Set thetoken
parameter to your ArcGIS access token.Display the image tiles in your scene by adding the provider to the viewer's
Imagery
.Layer Collection
Example
Add image tiles
This example shows how to add a custom image tile layer hosted in ArcGIS to your CesiumJS application.
Tutorials

Add features as GeoJSON
Add features from a feature service to a scene.

Add 3D objects
Add 3D objects from a scene service to a scene.

Add an integrated mesh
Add a textured mesh from a scene service to a scene.

Add image tiles
Add image tiles from an image tile service to a scene.

Display a pop-up (Feature)
Display feature attributes in a popup.

Display a pop-up (I3S)
Display I3S attributes in a popup.