Projections · Angular, React and OpenLayers
OGC API map tiles in WorldCRS84Quad
Display GTOPO30 Carpathian shaded relief from OGC API - Tiles using the geographic WorldCRS84Quad matrix set in an EPSG:4326 OpenLayers view.

What this example shows
Centred south of Kraków ([x]="19.94" [y]="49.75") at [zoom]="8" to frame the Kraków–Częstochowa Upland, Podhale basin and high Tatra peaks along the Slovak border, classic GTOPO30 elevation relief streams as WorldCRS84Quad map tiles directly into a native EPSG:4326 view without client reprojection.
When you need it
When an OGC API - Tiles server publishes both WebMercatorQuad and geographic WorldCRS84Quad pyramids, pairing an EPSG:4326 map view with WorldCRS84Quad avoids browser tile warping and preserves sharp server-rendered pixels.
Understanding the 1-level zoom offset between OpenLayers’ default EPSG:4326 view and OGC’s WorldCRS84Quad standard clarifies how resolution ladders align.
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.
ogc-map-tiles-geographic.tsimport { ChangeDetectionStrategy, Component } from '@angular/core';
import {
CoordinateComponent,
DefaultControlComponent,
DefaultInteractionComponent,
LayerTileComponent,
MapComponent,
SourceOGCMapTileComponent,
ViewComponent,
} from 'cc-openlayers';
/**
* The GTOPO30 shaded relief around Kraków as map tiles from an OGC API - Tiles service in the geographic WorldCRS84Quad
* tile matrix set, shown in a geographic view. The tileset lies in the gallery's assets: its tiles are CubeWerx's, but
* the server's own description names the axes latitude first and gives the origin longitude first, which OpenLayers
* reads swapped.
*/
@Component({
selector: 'app-ogc-map-tiles-geographic',
imports: [
CoordinateComponent,
DefaultControlComponent,
DefaultInteractionComponent,
LayerTileComponent,
MapComponent,
SourceOGCMapTileComponent,
ViewComponent,
],
changeDetection: ChangeDetectionStrategy.OnPush,
template: `
<aol-map height="480px">
<aol-interaction-default />
<aol-control-defaults />
<aol-view projection="EPSG:4326" [zoom]="8">
<aol-coordinate [x]="19.94" [y]="49.75" srid="EPSG:4326" />
</aol-view>
<aol-layer-tile>
<aol-source-ogcmaptile
[url]="url"
projection="EPSG:4326"
attributions="GTOPO30: U.S. Geological Survey; tiles: CubeWerx"
/>
</aol-layer-tile>
</aol-map>
`,
})
export class OgcMapTilesGeographic {
/** The tileset document, as an absolute URL: OpenLayers resolves the tile links against it. */
protected readonly url = new URL('assets/ogc/relief-WorldCRS84Quad.json', document.baseURI).href;
} 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.
ogc-map-tiles-geographic.react.tsximport {
Coordinate,
DefaultControls,
DefaultInteractions,
Map,
OGCMapTileSource,
TileLayer,
View,
} from 'cc-openlayers/react';
/** The tileset document, as an absolute URL: OpenLayers resolves the tile links against it. */
const URL_OF_TILESET = new URL('assets/ogc/relief-WorldCRS84Quad.json', document.baseURI).href;
/**
* The GTOPO30 shaded relief around Kraków as map tiles from an OGC API - Tiles service in the geographic WorldCRS84Quad
* tile matrix set, shown in a geographic view. The tileset lies in the gallery's assets: its tiles are CubeWerx's, but
* the server's own description names the axes latitude first and gives the origin longitude first, which OpenLayers
* reads swapped.
*/
export function OgcMapTilesGeographic() {
return (
<Map height="480px">
<DefaultInteractions />
<DefaultControls />
<View projection="EPSG:4326" zoom={8}>
<Coordinate x={19.94} y={49.75} srid="EPSG:4326" />
</View>
<TileLayer>
<OGCMapTileSource
url={URL_OF_TILESET}
projection="EPSG:4326"
attributions="GTOPO30: U.S. Geological Survey; tiles: CubeWerx"
/>
</TileLayer>
</Map>
);
}How the React version works
The GTOPO30 shaded relief of the Carpathians south of Kraków as OGC API – Tiles map tiles in the WorldCRS84Quad matrix set, in a view in degrees.
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. The example has no shared file; the tileset URL is a module constant in React.
From Angular to React
| Angular | React |
|---|---|
<aol-source-ogcmaptile [url]="url" projection="EPSG:4326"> | <OGCMapTileSource url={URL_OF_TILESET} projection="EPSG:4326"> |
<aol-view projection="EPSG:4326" [zoom]="8"> | <View projection="EPSG:4326" zoom={8}> |
<aol-coordinate [x] [y] srid="EPSG:4326" /> inside the view | <Coordinate x y srid="EPSG:4326" /> inside View |
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-ogcmaptile reads a local tileset JSON descriptor at [url]="url" (with corrected longitude-first axis metadata pointing at CubeWerx’s GTOPO30 tile endpoint) and configures projection="EPSG:4326" to match the view.
Because OpenLayers’ EPSG:4326 view starts zoom 0 as one 256 px tile spanning 360° (1.40625°/px) whereas OGC WorldCRS84Quad starts matrix 0 as two 256 px tiles (0.703125°/px), [zoom]="8" (~0.0055°/px) cleanly requests matrix level 7.
How it works
aol-source-ogcmaptileparses theWorldCRS84Quadtileset JSON at[url]="url"withprojection="EPSG:4326".- Bundled JSON metadata fixes the upstream axis declaration while linking live GTOPO30 relief tiles.
- View
[zoom]="8"(0.0055°/px) maps 1:1 toWorldCRS84Quadmatrix 7 becauseWorldCRS84Quadstarts with two world tiles at level 0. - Centring at
[x]="19.94" [y]="49.75"frames both Kraków and the Tatra Mountains.
Pitfalls
- OpenLayers interprets a tile matrix’s pointOfOrigin according to the orderedAxes declared in the TileMatrixSet JSON—if an upstream server declares Lat, Long axes while writing [-180, 90] longitude-first, OpenLayers swaps the origin into the wrong corner unless corrected.
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.