CQL Filters with LEaflet

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

CQL Filters with LEaflet

cliff
Does anyone know if we can use CQL filters with Leaflet with a WMS from Geoserver (2.14.1)? If so, what is wrong with my Leraflet code below?

  var cities = L.tileLayer.wms('http://localhost:8080/geoserver/ows?', {
      layers: 'workspace:cities',
      format: 'image/png',
      transparent: true,
      cql_filter:'city=London',
  }).addTo(map);

Note that the layer loads fine without the "cql_filter..." line.

Thanks!

Cliff


_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this list:
- Earning your support instead of buying it, but Ian Turton: http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: CQL Filters with LEaflet

tõnis kärdi
A stab in the dark but maybe enclose the value in quotation marks like 

cql_filter:"city='London'"?


All the best,
Tõnis

Saatja Cliff Patterson <[hidden email] kirjutas kuupäeval L, 9. veebruar 2019 21:41 järgmist:
Does anyone know if we can use CQL filters with Leaflet with a WMS from Geoserver (2.14.1)? If so, what is wrong with my Leraflet code below?

  var cities = L.tileLayer.wms('http://localhost:8080/geoserver/ows?', {
      layers: 'workspace:cities',
      format: 'image/png',
      transparent: true,
      cql_filter:'city=London',
  }).addTo(map);

Note that the layer loads fine without the "cql_filter..." line.

Thanks!

Cliff
_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this list:
- Earning your support instead of buying it, but Ian Turton: http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users


_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this list:
- Earning your support instead of buying it, but Ian Turton: http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: CQL Filters with LEaflet

tõnis kärdi
No problem at all :)

Tõnis


Saatja Cliff Patterson <[hidden email] kirjutas kuupäeval L, 9. veebruar 2019 22:14 järgmist:
Hi Tõnis,

The minute after I sent this request, I tried it again with quotation marks and all caps on the CQL_FILTER and it worked. Problem solved. Here is the working code for anyone who stumbles across this:

  var cities = L.tileLayer.wms('http://localhost:8080/geoserver/ows?', {
      layers: 'workspace:cities',
      format: 'image/png',
      transparent: true,
      CQL_FILTER:"city='London'",
  }).addTo(map);

Big thanks for your reply!

Cliff

On Sat, Feb 9, 2019 at 3:07 PM Tõnis Kärdi <[hidden email]> wrote:
A stab in the dark but maybe enclose the value in quotation marks like 

cql_filter:"city='London'"?


All the best,
Tõnis

Saatja Cliff Patterson <[hidden email] kirjutas kuupäeval L, 9. veebruar 2019 21:41 järgmist:
Does anyone know if we can use CQL filters with Leaflet with a WMS from Geoserver (2.14.1)? If so, what is wrong with my Leraflet code below?

  var cities = L.tileLayer.wms('http://localhost:8080/geoserver/ows?', {
      layers: 'workspace:cities',
      format: 'image/png',
      transparent: true,
      cql_filter:'city=London',
  }).addTo(map);

Note that the layer loads fine without the "cql_filter..." line.

Thanks!

Cliff
_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this list:
- Earning your support instead of buying it, but Ian Turton: http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users


_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this list:
- Earning your support instead of buying it, but Ian Turton: http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users