Tile and image services · Angular, React and OpenLayers

Esri's topographic map as XYZ tiles

Render Esri World Topographic Map cached raster tiles on the GPU in OpenLayers using ArcGIS {z}/{y}/{x} URL ordering and a WebGLTileLayer.

Esri's topographic map of Kraków at zoom 11, with the A4 motorway, the Vistula, Las Wolski and the towns around the city, from Skawina to Wieliczka and Niepołomice.
A screenshot of the example. Base map: Esri World Topographic Map (Esri, HERE, Garmin, Intermap, increment P Corp., GEBCO, USGS, FAO, NPS, NRCAN, GeoBase, IGN, Kadaster NL, Ordnance Survey, Esri Japan, METI, Esri China (Hong Kong), OpenStreetMap contributors and the GIS User Community).

What this example shows

At zoom 11 across the Kraków metropolitan basin—from Skawina and Las Wolski to Wieliczka and Niepołomice—Esri’s World Topographic Map displays contour shading, motorways, hydrography and administrative hierarchy rendered smoothly through a GPU-accelerated WebGL tile layer.

When you need it

Organisations using ArcGIS Online or enterprise ArcGIS Server tile caches frequently want to combine those pre-rendered basemaps inside lightweight OpenLayers apps without bundling a separate ArcGIS JS SDK.

Because cached ArcGIS Web Mercator services use the exact same top-left origin and zoom resolutions as OpenStreetMap, a plain URL template integrates them natively alongside any OGC or vector layer.

The code

The example uses cc-openlayers, my Angular component library for OpenLayers: each aol-… element creates the OpenLayers object it names, updates it from its inputs and disposes of it with the component.

xyz-esri.ts
import { ChangeDetectionStrategy, Component } from '@angular/core';
import {
  CoordinateComponent,
  DefaultControlComponent,
  DefaultInteractionComponent,
  MapComponent,
  SourceImageTileComponent,
  ViewComponent,
} from 'cc-openlayers';
import { LayerWebGLTileComponent } from 'cc-openlayers/webgl';

/** Esri's World Topographic Map, read as XYZ tiles by an image tile source and drawn by a WebGL tile layer. */
@Component({
  selector: 'app-xyz-esri',
  imports: [
    CoordinateComponent,
    DefaultControlComponent,
    DefaultInteractionComponent,
    LayerWebGLTileComponent,
    MapComponent,
    SourceImageTileComponent,
    ViewComponent,
  ],
  changeDetection: ChangeDetectionStrategy.OnPush,
  template: `
    <aol-map height="480px">
      <aol-interaction-default />
      <aol-control-defaults />
      <aol-view [zoom]="11">
        <aol-coordinate [x]="19.9368" [y]="50.0614" srid="EPSG:4326" />
      </aol-view>
      <aol-layer-webgltile>
        <aol-source-imagetile [url]="url" [attributions]="attributions" />
      </aol-layer-webgltile>
    </aol-map>
  `,
})
export class XyzEsri {
  protected readonly url =
    'https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}';
  protected readonly attributions =
    'Tiles © <a href="https://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer">ArcGIS</a>';
}

Architecture and OpenLayers mechanics

Pre-cached ArcGIS REST tile endpoints end in /tile/{z}/{y}/{x}, placing tile row {y} ahead of tile column {x} while still counting zoom levels, rows and columns from the northwest corner of Web Mercator.

Wrapping the image-tile source inside aol-layer-webgltile uploads incoming CORS-enabled JPEGs straight to GPU textures for high-frame-rate panning, zooming and optional colour manipulation.

How it works

  • ArcGIS tile cache url templates end in {z}/{y}/{x}, addressing zoom level first, north-origin row second and column third.
  • Origin and resolution steps match the default Web Mercator pyramid, requiring no custom tileGrid definition.
  • aol-layer-webgltile renders the CORS-cleared tiles as WebGL textures on the GPU.

Pitfalls

  • Writing {z}/{x}/{y} by habit instead of {z}/{y}/{x} returns HTTP 200 tiles transposed across the diagonal of the world—always double-check row-before-column order on ArcGIS REST URLs.
  • Include the full contributor copyright string listed in the ArcGIS service metadata rather than crediting the host name alone.

The same feature in the OpenLayers examples .

Background: state and lifecycle of maps in Angular with OpenLayers, which the components of cc-openlayers take care of.