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.

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.tsimport { 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>';
} The React version uses the library's React adapter, cc-openlayers/react: each component creates the OpenLayers object it names when it mounts, updates it from its props and disposes of it when it unmounts.
xyz-esri.react.tsximport { Coordinate, DefaultControls, DefaultInteractions, ImageTileSource, Map, View } from 'cc-openlayers/react';
import { WebGLTileLayer } from 'cc-openlayers/react/webgl';
const URL = 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}';
const ATTRIBUTIONS =
'Tiles © <a href="https://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer">ArcGIS</a>';
/** Esri's World Topographic Map, read as XYZ tiles by an image tile source and drawn by a WebGL tile layer. */
export function XyzEsri() {
return (
<Map height="480px">
<DefaultInteractions />
<DefaultControls />
<View zoom={11}>
<Coordinate x={19.9368} y={50.0614} srid="EPSG:4326" />
</View>
<WebGLTileLayer>
<ImageTileSource url={URL} attributions={ATTRIBUTIONS} />
</WebGLTileLayer>
</Map>
);
}How the React version works
Esri's topographic map read as XYZ tiles and drawn by a WebGLTile layer.
What both versions share
OpenLayers renders the map and handles the interactions; the cc-openlayers/core layer gives both adapters the same view binding (MapViewBinding) and the same conversion of coordinates from EPSG:4326 to the map's projection.
From Angular to React
| Angular | React |
|---|---|
<aol-layer-webgltile> | <WebGLTileLayer> from cc-openlayers/react/webgl |
<aol-source-imagetile> | <ImageTileSource> |
Who creates, updates and disposes
Map creates the ol/Map in useLayoutEffect and disposes of it on unmount; each layer, source and interaction component adds its object to the parent it gets from context and removes it in its effect's cleanup, as ngOnDestroy does in Angular.
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
urltemplates 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-webgltilerenders 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.
Related examples
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.