2

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?

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

1 Answer 1

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);
1
  • Thanks for the info.I want to load in Mapbox GL JS Sep 30, 2019 at 12:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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