I have been using GeoServer WMS layers with OpenLayers 3 and it is working well. Below is the code how I have used to add my GeoServer WMS layer to the Mapbox GL API:

   var mapOptions: MapboxOptions = {
  container: 'map',
  style: 'mapbox://styles/mapbox/light-v10',
  zoom: 17.5,
  center: [0.5500863948437313, 53.229982583617584],
  pitch: 60

this.mapInstance = new Map(options);
var layerConfig: mapboxgl.Layer = {
  'id': 'wms-test-layer',
  'type': 'raster',
  'source': {
    'type': 'raster',
    'tiles': [
    'tileSize': 256
  'paint': {}


same with OpenLayers is working fine but in Mapbox GL API I am getting below error

ERROR Error: Style is not done a the loading at i._checkLoaded (mapbox-gl.js:33) at i.addLayer (mapbox-gl.js:33) at r.addLayer (mapbox-gl.js:33) at MapComponent.push../src/app/map/map.component.ts.MapComponent.addWmsLayer (map.component.ts:363)

LOOKS like the official sample itself is not loading as their services are no longer available Mapbox-gl WMS sample

  • A style parameter is required for a GetMap request, unless you supply an SLD or SLD_BODY parameter, in which case it is optional but you don't seem to be supplying one ~ what request gets generated? – nmtoken Apr 1 at 16:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.