Best Practices for using Tile Layers as Operational Layers

Complex global geometries can sometimes be slow to draw in web apps, especially if the data includes multiple countries with islands, long coastlines, and jagged boundaries. Make tile layers your operational layer type of choice to optimize drawing performance of complex geometries at small scales. Tile layers support fast visualization of large datasets using a collection of pre-created map images or tiles. This blog covers how to identify slow-drawing geometry in operational layers and some tips and tricks for using hosted tile layers.

Identify geometry that causes maps to draw slowly

 ArcGIS Online web apps request spatial and attribute information from operational layers (web services) to display and visualize data in the application. The speed in which the data is displayed in the application is determined by the request and response time. A large amount of information, (size), in a response will result in a slower response time than a small amount of information. As an example, click on this link and take note of how long it takes for the operational layer to load. It should take about 1-3 seconds which isn’t a great experience for users. The countries layer in the app uses a hosted feature layer as an operational layer. The response from a feature layer request contains geometry, x and y information for each vertex or point and attribute information.  To determine if the size of the response from a request is resulting in a slow response time, calculate the number of vertices and the number of attributes for your dataset. Read this Geonet Blog for more information on monitoring web requests. 

To determine the complexity of the geometry in this dataset, the vertices for each country were calculated as a new field in ArcGIS Pro prior to publishing the feature layer to ArcGIS Online. Overall there are 237,604 vertices, with 5 countries making up for 45% of the vertices, resulting in a response size of 1.2 MB. 

As generalizing the geometry or eliminating Canada, Russia, Greenland and the United States won’t accurately visualize the global data in the dataset, and users don’t want to have to wait for the initial layer to draw, the next tips will show how to best use a hosted tile service to improve the drawing speed of the application, by minimizing the response size.

Tip 1: Create a hosted tile layer from a hosted feature layer

Within ArcGIS Online, open the item page of your hosted feature layer and go to the Visualization tab. Choose your desired symbology for your tile layer by changing the style on the feature layer and select Save Layer.

Select Publish> Tile Layer from the Overview tab

Ensure that display with ArcGIS Online is selected. This parameter determines the tiling scheme that will be used for the tile layer, which needs to match the basemap. Selecting ArcGIS Online basemaps ensures that the tile layer will have a tiling scheme that matches the ArcGIS Online basemaps.

When you publish a hosted tile layer from a hosted feature layer, a relationship between the two items is established. This allows the application to query attributes from the feature layer while using the tile layer for visualization.

Tip 2: Build only the tiles that you need to improve drawing speed at specific scales

As the large response sizes are resulting from requests of the entire dataset at a small scale, the performance will improve when the data is displayed at a smaller scale with tiles. For this reason, only create tiles at the smallest scales and use the feature layer as the operational layer at large scales.

For this example, build the top 8 scale levels, creating 26,760 tiles, costing 26.76 credits.

Tip 3. Enable pop-ups on your hosted tile layer

Once the tiles have created, open the tile layer in Map Viewer and enable pop-ups. As this tile layer was created from a hosted feature layer, the pop-up is already configured to refer to the feature layer for attribute data.

Configure the pop-up to display your desired data. If it was configured for the hosted feature layer, the same settings will be applied. Click this link for tips on configuring pop-ups.

Tip 4. Set the scale visibility on the tile layer and feature layer so they display when needed

As tiles were created for the eight smallest scales in tip 2, add the original hosted feature layer to the same web map so that there is data that will be displayed at the largest scale.

Once both the tile and feature layer are added to Map Viewer, turn off the top layer (feature layer), by unchecking the check box. Zoom slowly until the tile layer doesn’t draw then zoom out one level.  Set the visible scale range so that the tile layer can be viewed from the world range to the current visible tiles:

Zoom in one level so the tile layer disappears and unclick the content check box on the tile layer (the second layer in Contents). Check the feature layer check box and repeat the step to set the scale visibility so the feature layer is visible from the current scale to the largest scale.

Zoom in and out to ensure that both layers are not turned on at the same time and that there is a seamless transition from feature layer to tile layer.

Create an app from your web map and bask in the superb performance that you have just created using best practices with tile layers. The response size of the request to the operational layer (tile layer) was 150 KB, where the feature layer response was 1.2MB.

Now compare the initial load performance of the following apps:

Operational Layer : Tile Layer

Operational Layer: Feature Layer

Operational Layer: Tile and Feature Layer with scale dependency

This entry was posted in ArcGIS Online, Services and tagged , , , , , , , , . Bookmark the permalink.

Leave a Reply

2 Comments

  1. jms1222 says:

    Kelly, for point data why wouldn’t you use layers that point to a dynamic map service? It’s how I’ve gotten around the 1,000 feature display limitation on web maps because the points are essential little picture files, if I remember correctly. Is tile layers the new way to accomplish this in ArcGIS Online? I also noticed you can’t do labels with these layers, only pop-ups. Will that likely change in the future?

    • Kelly Gerrow says:

      Great Question,

      There isn’t a 1000 feature limit in ArcGIS Online for displaying points. Check out this answer for more details on how the map viewer displays large amounts of points: http://www.esri.com/about/events/uc/get-involved/q-and-a#id=1590

      Tile layers can be used to display large amounts points quickly without requesting the specific geometry from the server. That being said, geometry is not very complex for point features, so doesn’t run into the same complexities when drawing the data. You can use a dynamic map service if you are using ArcGIS Server. The tiled layers in the article are sometimes referred to as cached map services. If you are trying to display a large amount of points, eventually it will become visually confusing as you show many many points. To overcome this visualization issue, I’d suggest aggregating the data or looking into visualizations to show large amounts of point data.

      If you are noticing that all of your points aren’t drawing or there is significant slowness, you can use tiled layers to improve the performance. The request to the service for a tiled service is much smaller than a request for the vector geometry data. Check out this geonet blog for specifics on that tile requests verses feature queries: https://geonet.esri.com/groups/cats/blog/2017/05/04/monitoring-web-service-requests-from-web-apps

      Labels can be generated for tile services if they are enabled on the layer prior to publishing the tiled layer.