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.

Kraków's road noise map of 2022 at zoom 12 within the city limits: bands from orange to red along the roads, purple and blue, 70 decibels and more, along the loudest, over OpenStreetMap.
A screenshot of the example. Road noise map 2022: Miasto Kraków (MSIP). Map data © OpenStreetMap contributors.

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.ts
import { 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');
}

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-tilearcgisrest calls the dynamic ArcGIS export endpoint per grid tile as a transparent PNG.
  • [params] sets LAYERS: '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 export calls.

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.