Map layers

Maps are composed of a series of map layers drawn in a particular order. Each layer defines where a specific GIS dataset is located and how it is portrayed in the map using symbols and labels. Examples of map layers include streams and lakes, terrain, roads, political boundaries, parcels, building footprints, utility lines and orthophoto imagery. The layer references the data stored in a geodatabase, map service or tiled service and so on, rather than actually storing the geographic data. Therefore a layer will always access the most up-to-date information in your data source. Layers are displayed in bottom to top order so that subsequent layers are rendered on top of previous layers. Layers supported by this SDK are listed as follows:

A configuration of layers and services can be authored and saved in ArcGIS Online in a web map. The web map is accessed via its uniform resource locator (URL) and is used to construct the entire map. Explore more about web maps later in this section.

Tiled map service layers

Tiled map service layers are connected to cached map services (either from ArcGIS Server or Bing), which provide map images at predefined scales within a tiling scheme set by the server. The individual map image tiles are raster (also called bitmap) images that are drawn onto the map component (JMap).

ArcGISTiledMapServiceLayer - ArcGIS for Server cached map service hosting a set of map image tiles.

ArcGISLocalTiledLayer - Local cached map containing a set of image tiles either delivered in a locally held tile package (.tpk) or in an exploded cache.

BingMapsLayer - Bing Maps map imagery layer. Provides access to precached roads and aerial imagery.

OpenStreetMapLayer - OpenStreetMap imagery layer with option to set the tileservers to use.

Functional characteristics

Because these images are pre-created by the server, it is not possible to change the visibility of the individual layers or the service's default spatial reference of the map (they can be considered as static map services). In addition to this, the data cannot change over time unless the cache is refreshed and it is not possible to query these layers. They are commonly used for basemaps.

Performance characteristics

Tiled map services are some of the fastest map services available in the API. The map images are pre-created and cached by the server and are returned from the server very quickly. Multiple images are usually returned for a single map extent, which means the requests are multithreaded and handled asynchronously (tiles are requested and drawn individually from one another). This asynchronous model means there will be a lot of small requests to the server for this type of layer and there will be little client-side processing as images are drawn quickly. The size of each returned image increases as the resolution or complexity of the images increase. For example, high-resolution imagery tiles will be larger in file size than topographic mapping for the same area and map extent.

Dynamic map service layers

Dynamic map service layers are connected to a non-cached map service that generates map images on the fly. This non-cached map service can provide dynamic access to both vector and raster data sources. These are rendered by the server on request and returned as a single raster image. The image does not contain any information about the features in the map.

ArcGISDynamicMapServiceLayer - ArcGIS for Server non-cached map service that generates map images on the fly. Non-cached map services provide dynamic access to both vector and raster data sources.

ArcGISLocalDynamicMapServiceLayer - Local non-cached map providing dynamic access to both vector and raster data sources. This is delivered through a locally held map package (.mpk).

ArcGISImageServiceLayer - ArcGIS for Server image service that generates map images on the fly. Image services provide dynamic access to raster data sources.

Functional characteristics

As map images are drawn by the server on every request, the data can change over time and will be seen by the user (as long as they request a new image since the change has taken place). In addition to this, the visibility of individual map layers can be changed and the data shown can be filtered by adding individual layer definition expressions. The spatial reference of this layer type can be changed from the service's default and ArcGIS Server re-projects each image on the fly although there is no direct method for setting this, as the map's spatial reference is based on the first layer that is added.

Performance characteristics

For every map request, ArcGIS Server creates a map image on the fly and therefore, the rendering time depends on the amount and complexity of the data in the map. However, if the map service is well optimized, this should be relatively quick but will typically take longer than for a tiled map service layer. The file size of the returned map image also depends on the data in the map but will be drawn on the map screen quickly as it requires little client-side processing. Therefore, it is a good candidate for showing features that change over time or require some sort of filtering by the user, as long as the feature information (attributes, geometry, or symbol) is not required.

It is often used in conjunction with a feature layer in selection mode to show the latest map data without having to pull all of the feature information from the server (as with feature layers) on every map request.

Dynamic layers are commonly used as operational layers and can be used as a basemap layer if no tiled map service layer is being used.

Feature layers

Feature layers represent layers that contain features (geometry and attributes) and are hosted by a service. The feature layer type provides a convenient class to reference a feature layer in an ArcGIS for Server map service, local map service or a spatial table using a spatial data service. Graphic features are retrieved from the service and rendered on the client using graphic capabilities native to the ArcGIS Runtime SDK for Java. These features are created in the feature layer from a JavaScript Object Notation (JSON) response from an ArcGIS Server feature service or map service.

ArcGISFeatureLayer - a special type of GraphicsLayer that allows you to display features from a layer hosted by an ArcGIS Server map service or feature service. The layer can be either a spatial layer or a non-spatial table. If the layer is editable, you can add, update and delete features.

ArcGISLocalFeatureLayer - a local feature layer allows you to display features from a layer provided by a locally held map package (.mpk) file. Features can be edited by the LocalFeatureService.

Functional characteristics

Feature layers provide the richest functionality out of any of the layer types because they contain complete information about all of the features displayed on the map. They can be created from server feature services, which provide edit operations. The individual features in these layers can be queried and filtered based on spatial queries or text-based WHERE clauses. The feature layer classes extend the GraphicsLayer class, so all of the graphics layers' methods are also available.

Performance characteristics

The rich functionality of the feature layer comes at a slight cost in terms of request processing times the server, response processing times, and rendering speed. This is because the information about each feature is returned by the server, parsed and processed on the device, and drawn onto the screen. However, as long as these issues are understood and the settings of the feature layer are applied appropriately, they allow you to build exciting and functionally rich applications.

Graphics layers

Graphics layers are application defined layers designed for drawing dynamic features on the map. Each graphic is defined by its own individual geometry, attributes and symbol so that many different geometry types can co-exist in one graphics layer. The graphics can be used to hold polygons drawn by a user, display features that satisfy a user-defined query, or show a real-time Global Positioning System (GPS) location. All graphics in a graphics layer are stored in memory and are only available while the application is running.

Functional characteristics

The graphics layer is responsible for drawing features on the map in spatial coordinates. It is not designed for drawing non-geographical based features such as north arrows or copyright text. As this layer contains information on the features, it is possible to query the layer using screen coordinates to return features using the getGraphics() method. It is also possible to set the layer's scale thresholds using the setMinScale or setMaxScale methods.

Performance characteristics

The graphics layer does perform well and is the basis of the feature layer class. It is important to remember that the performance of the graphics layer is directly related to the number of features that you add to the layer.

Web maps

A web map is not an individual layer, rather it is a reference to a configuration of multiple map layers and services authored and saved in ArcGIS Online. Each web map is accessed via its uniform resource locator (URL) and is used to construct an entire map (JMap). Web maps can be secured, shared to groups or shared publicly.

Web maps contain not only a number of layers but also configuration about the layers such as their transparency, name, and draw order. It also contains map configuration information such as the initial extent. Once a web map has been added to a map you can add any additional layers to the map. The functional and performance characteristics of a web map depends on the map service layers that it contains. A web map that is supported by this SDK can contain any of the map layer types discussed in this topic.

Because a web map defines the configuration of the map and layers it has many advantages over a traditional approach. For example, you may want to change the configuration of the layers in your map or change the initial extent. With a web map, this can be done online and outside of your application code, reducing the need for application redeployment.

2/7/2013