Tile and image services · Angular, React and OpenLayers
An ArcGIS map service as tiles
Request Kraków’s 2022 road noise map tile by tile from a dynamic ArcGIS MapServer REST service within city bounds at native HiDPI density.

What this example shows
At zoom 12 across Kraków, official 2022 road-traffic noise corridors—graded from orange and red to purple and dark blue above 70 dB along major arteries—load progressively tile by tile from the city’s dynamic ArcGIS MapServer over OpenStreetMap, bounded strictly to the municipal territory.
When you need it
Uncached dynamic ArcGIS MapServer layers with heavy vector-to-raster symbology can take several seconds to render a full-screen 4K viewport as a single image.
Querying that same dynamic export endpoint on a 256-pixel tile grid lets browsers cache previously visited squares, streams visible tiles in parallel and fetches only newly exposed edges when panning.
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.
arcgis-tiled.tsimport { ChangeDetectionStrategy, Component } from '@angular/core';
import { transformExtent } from 'ol/proj';
import {
CoordinateComponent,
DefaultControlComponent,
DefaultInteractionComponent,
LayerTileComponent,
MapComponent,
SourceOsmComponent,
SourceTileArcGISRestComponent,
ViewComponent,
} from 'cc-openlayers';
/** Kraków's 2022 road noise map, a dynamic ArcGIS map service requested tile by tile over OpenStreetMap. */
@Component({
selector: 'app-arcgis-tiled',
imports: [
CoordinateComponent,
DefaultControlComponent,
DefaultInteractionComponent,
LayerTileComponent,
MapComponent,
SourceOsmComponent,
SourceTileArcGISRestComponent,
ViewComponent,
],
changeDetection: ChangeDetectionStrategy.OnPush,
template: `
<aol-map height="480px">
<aol-interaction-default />
<aol-control-defaults />
<aol-view [zoom]="12">
<aol-coordinate [x]="19.9368" [y]="50.0614" srid="EPSG:4326" />
</aol-view>
<aol-layer-tile><aol-source-osm /></aol-layer-tile>
<aol-layer-tile [extent]="city">
<aol-source-tilearcgisrest
url="https://msip.um.krakow.pl/arcgis/rest/services/Mapa_halasu_2022/8_2_MH_2022_IMISJA_5/MapServer"
[params]="{ LAYERS: 'show:1' }"
attributions="Noise map 2022: Miasto Kraków (MSIP)"
/>
</aol-layer-tile>
</aol-map>
<div class="example-controls">
<p class="example-hint">Road noise over the day, evening and night (L<sub>DEN</sub>), within the city limits.</p>
</div>
`,
})
export class ArcgisTiled {
/** The city, where the service has data: the layer requests no tiles outside it. */
protected readonly city = transformExtent([19.79, 49.96, 20.22, 50.13], 'EPSG:4326', 'EPSG:3857');
} 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.
arcgis-tiled.react.tsximport { transformExtent } from 'ol/proj.js';
import {
Coordinate,
DefaultControls,
DefaultInteractions,
Map,
OSMSource,
TileArcGISRestSource,
TileLayer,
View,
} from 'cc-openlayers/react';
/** The city, where the service has data: the layer requests no tiles outside it. */
const CITY = transformExtent([19.79, 49.96, 20.22, 50.13], 'EPSG:4326', 'EPSG:3857');
const PARAMS = { LAYERS: 'show:1' };
/** Kraków's 2022 road noise map, a dynamic ArcGIS map service requested tile by tile over OpenStreetMap. */
export function ArcgisTiled() {
return (
<>
<Map height="480px">
<DefaultInteractions />
<DefaultControls />
<View zoom={12}>
<Coordinate x={19.9368} y={50.0614} srid="EPSG:4326" />
</View>
<TileLayer>
<OSMSource />
</TileLayer>
<TileLayer extent={CITY}>
<TileArcGISRestSource
url="https://msip.um.krakow.pl/arcgis/rest/services/Mapa_halasu_2022/8_2_MH_2022_IMISJA_5/MapServer"
params={PARAMS}
attributions="Noise map 2022: Miasto Kraków (MSIP)"
/>
</TileLayer>
</Map>
<div className="example-controls">
<p className="example-hint">
Road noise over the day, evening and night (L<sub>DEN</sub>), within the city limits.
</p>
</div>
</>
);
}How the React version works
Kraków's road noise map from a dynamic ArcGIS service, fetched tile by tile over OpenStreetMap and limited to the city.
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-source-tilearcgisrest [params]> | <TileArcGISRestSource params> with a module constant |
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
aol-source-tilearcgisrest issues per-tile ArcGIS REST export requests as transparent PNGs. Passing LAYERS: 'show:1' inside [params] isolates sublayer 1 (combined day-evening-night road noise), while setting [extent] on the tile layer suppresses tile requests outside Kraków’s administrative bounding box.
On Retina / HiDPI displays, OpenLayers automatically scales requested tile pixel dimensions and raises the ArcGIS dpi parameter proportionally so linework and contours stay razor-sharp.
How it works
aol-source-tilearcgisrestcalls the dynamic ArcGISexportendpoint per grid tile as a transparent PNG.[params]setsLAYERS: 'show:1'so the server draws only the road-noise sublayer.- Layer
[extent]restricts tile requests to the service’s rectangular data box around Kraków, skipping anything outside it. - High-density screens automatically request scaled tile dimensions with matching server dpi adjustments.
Pitfalls
- Because ArcGIS draws each dynamic tile independently without meta-tile buffering, text labels or wide symbols straddling tile borders may be clipped or duplicated—prefer single-image ImageArcGISRest when label continuity matters more than tile caching.
- If an ArcGIS MapServer already has a pre-rendered tile cache (tileInfo in service JSON), consume its static /tile/{z}/{y}/{x} cache via XYZ/ImageTile instead—cached tiles are an order of magnitude faster than dynamic
exportcalls.
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.