Skip to content

Extent property added for raster style types - #519

Merged
dannyleech merged 1 commit into
mainfrom
raster-extent-addition
Sep 11, 2026
Merged

Extent property added for raster style types#519
dannyleech merged 1 commit into
mainfrom
raster-extent-addition

Conversation

@dannyleech

Copy link
Copy Markdown
Contributor

Raster tile sources have no way to limit tile requests to their real extent

Unlike the other mapStyle types, an OpenLayers type: 'raster' (plain XYZ) source has no extent set on its TileGrid. This means tile requests can be made anywhere across the whole tile grid, not just where the tile service actually has coverage — leading to 404s in the console whenever the map is panned or zoomed into an area outside the service's real extent.

Fix

Adds an optional extent property to mapStyle config, passed through to the OpenLayers TileGrid to constrain which tiles get requested. It only affects which tiles are requested — panning and zooming are unaffected, so users can still move outside the extent (they'll just see the background colour instead of failed requests).

This is opt-in and backwards compatible: omitting extent keeps today's behaviour unchanged. There's no discovery protocol for a bare XYZ tile URL to determine its own coverage, so this has to be supplied explicitly by whoever configures the style.

@sonarqubecloud

Copy link
Copy Markdown

@dannyleech
dannyleech merged commit cab1cbd into main Sep 11, 2026
2 checks passed
@dannyleech
dannyleech deleted the raster-extent-addition branch September 11, 2026 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants