1

I've published some layers in GeoServer which I want to consume in Mapbox.
I've tried several examples like:

But I'm not been able to get any good result, I've got this as the best result till now

example using the code

map.addLayer({
    'id': 'wms-test-layer',
    'type': 'raster',
    'source': {
        'type': 'raster',
        'tiles': [
            'http://localhost:8080/geoserver/gwc/demo/topp:states?gridSet=EPSG:4326&format=image/png'

        ],
        'tileSize': 256
    },
    'paint': {}
}, 'aeroway-line');

What can I do?

  • 1
    is your map in epsg:4326? if not then you might want a different grid set – Ian Turton Sep 30 at 8:01
  • why not use wms layer as geoserver can provide wms service? – neogeomat Sep 30 at 8:37
  • @neogeomat yes I tried publishing and consuming as WMS layer but no luck – krishna lodha Sep 30 at 12:14
  • @IanTurton my Layer and Map both are 4326 – krishna lodha Sep 30 at 12:15
1

why not use wms layer as geoserver can provide wms service

var wmsLayer = L.tileLayer.wms('http://localhost:8080/geoserver/ows?', {
    layers: 'topp:states'
}).addTo(map);
  • Thanks for the info.I want to load in Mapbox GL JS – krishna lodha Sep 30 at 12:13

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.