2

Is there any way to query WMS tile layer for Mapbox GL?

map.addLayer({
    'id': 'wms-test-layer',
    'type': 'raster',
    'source': {
        'type': 'raster',
        'tiles': [
            'https://geodata.state.nj.us/imagerywms/Natural2015?bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&srs=EPSG:3857&width=256&height=256&layers=Natural2015'
        ],
        'tileSize': 256
    },
    'paint': {}
}, 'aeroway-taxiway');

and query like this ??

"filter": ["==", "icon", symbol]

Leaflet example:

var layer = L.tileLayer.betterWms('localserver/geoserver/geoserverlayer/wms?', {
    layers: '',
    format: 'image/png',
    transparent: true,
    version: '1.1.0',
    CQL_FILTER:'department_id like something',
    proxy:'',
    proxyParamName:'url'
}).addTo(map_pa);
1
  • The example service geodata.state.nj.us/imagerywms/Natural2015 does not seem to be be provided by GeoServer software – nmtoken Aug 14 '18 at 15:27
1

I have found the solution just pass the parameter in URL it will return the WMS image (png) of that particular query...

http://yourserder:8080/geoserver/VectorTileLayer/wms?service=WMS&version=1.1.0&cql_filter=circle_n=circle name&request=GetMap&layers=VectorTileLayer:table name&styles=&bbox=bounding boxof your desire&width=768&height=492&srs=EPSG:4326&format=image%2Fpng&transparent=true&

Find help from this URL

http://docs.geoserver.org/stable/en/user/services/wms/vendor.html#cql-filter

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.