5.4 Layer Types
5.4 Layer Types jed124ArcGIS Server publishes data layers of several different types, depending on whether the underlying data source is vector or raster, the amount of data being served, the needs of the apps consuming them, etc. In this part of the lesson, we’re going to walk through the most commonly used types, describing how they differ from one another, how they can be distinguished from layers of other types, under what circumstances they’re intended to be used, and how they are incorporated into an app.
In a moment, we'll take a detailed look at some commonly used layer types one by one. Before doing so, here are some important properties that are defined under the abstract Layer class that is the parent to all of the layer sub-classes:
- opacity: set to a value from 0 to 1, with 0 making the layer completely transparent and 1 making it completely opaque (solid),
- title: set to a string specifying how the layer is labeled in widgets like the Legend and LayerList,
- visible: set to a Boolean controlling whether or not the layer is turned on/off.
5.4.1 TileLayer
5.4.1 TileLayer ksc17Description:
- displays a full dataset using a series of adjacent tiles (smaller individual images that you can think of as snapshots of the complete map)
- a different set of tiles is created for each level of detail (zoom level)
- referred to as a cached service because the tiles are pre-created (i.e., not dynamically at the time the request for the layer is received by the server)
- can show data from many different underlying datasets at once
- often used as a basemap; in fact, most of the options when setting a Map’s basemap property result in the addition of a TileLayer
- changes in the underlying data cause the service to be out of date, so this layer type is best suited to data that changes infrequently
- tile creation can be a time consuming process; often automated to run overnight
- because you’re dealing with a picture of your data, you can’t implement popup windows
- can create your own using ArcMap or ArcGIS Pro (see GEOG 865)
How do I know I’m dealing with a TileLayer?
- labeled as a MapServer service in the REST Services Directory
- the service’s Single Fused Map Cache property will be true and it will have a Tile Info section
Class description in the SDK:
Example service:
Code sample:
- ArcGIS Maps SDK for JavaScript: Get started with layers
- TileLayer objects are created and stored in the transportationLyr and housingLyr variables
5.4.2 VectorTileLayer
5.4.2 VectorTileLayer ksc17Description:
- newer technology than raster tiles
- data are still cached, but aren’t just static pictures
- service passes geometry and styling info to client, which then does the rendering
- Attributes are not included, popups and other feature interactions are not available
- same set of tiles can be styled in many ways
- also mostly associated with basemaps; the -vector options of the Map’s basemap property result in the addition of a VectorTileLayer
- tile creation much shorter process than for raster tiles
- tile creation can be done in ArcGIS Pro, but not ArcMap
How do I know I’m dealing with a VectorTileLayer?
- unlike the other layer types described here, vector tile layers can only be discovered through ArcGIS Online or ArcGIS Portal
- in ArcGIS Online, when viewing the layer’s Details page, its Source will be listed as a Vector Tile Service and it will have a View Style button
Class description in the SDK:
Example service:
- several world-scale vector tile layers (all based on the same data, just styled differently) created by Esri and hosted on ArcGIS Online: ArcGIS Vector Basemaps
Code sample:
- ArcGIS Maps SDK for JavaScript Sandbox
- note the layer’s url property can be set to the service itself (and drawn with default styling) or to a JSON style object; see ArcGIS Maps SDK for JavaScript: VectorTileLayer
5.4.3 FeatureLayer
5.4.3 FeatureLayer ksc17Description:
- feature geometry and attributes sent to client; rendered on client
- features to stream to the client are often filtered using a definition expression
- having the geometry and attributes on the client enables the implementation of popup windows
- also supports several types of renderings (e.g., unique values, class breaks, etc.)
How do I know I’m dealing with a FeatureLayer?
- on ArcGIS Server instances, can be created from a service labeled as either MapServer or FeatureServer
- when dealing with a service containing multiple layers, must create the FeatureLayer from one of the service sub-layers
Class description in the SDK:
Example service:
Code sample:
5.4.4 MapImageLayer
5.4.4 MapImageLayer ksc17Description
- picture of your layer taken on the fly by the server and sent to client
- often a mix of different layers, each of which can be customized (renderer, definition expression, etc.)
- use if a FeatureLayer would be too much for client to handle
How do I create a MapImageLayer?
- On ArcGIS Server, instances can be created from a service labeled as MapServer
- can create from either the full service or a sub-layer
Class description in the SDK:
Example service:
Code sample:
5.4.5 ImageryLayer
5.4.5 ImageryLayer ksc17Description:
- stream of raster data from the server to the client device
- raster can have pixel filtering and rendering performed on the server or client