Add a WMS source untiled
✓ Published0🌍 Public
TThomasG77
Last edited Jan 9, 2023
Created on Jan 9, 2023
This example shows a MapLibre GL map displaying a French urban-area layer from a WMS service, overlaid on OpenStreetMap raster tiles. The map fetches a WMS GetMap request for the current viewport, using the SphericalMercator library to convert map bounds into EPSG:3857 coordinates for the request. When the user pans or zooms, the `moveend` event triggers removal and re-addition of the image source and raster layer, refreshing the WMS overlay. The code uses `map.addSource` and `map.addLayer` to manage the dynamic image layer.
AI-generated description