Hi,
I want to consume the Geoserver data in the leaflet, someone has an example index.html where I can see the procedures.
If possible with presentation of the legend.
Best regards
···
Endi SoaresGeógrafo
m:(+238) 5809479
a:Praia, Cabo Verdee:
esoares.bvc.2016@anonymised.com e: endy.soares89@anonymised.com

Geoserver is just another WMS provider from the point of view of leaflet. I would consider using one of WMS enhancement plugins, esp
Leaflet.wms and see examples eg
http://heigeo.github.io/leaflet.wms/examples/
Legend presentation is extremely application-dependent. However, it is just a case of deciding where an image is going to go and setting the img src attribute with javascript to a wms GetLegendGraphic call. For scale-dependent legends, set a handler to L.map.zoomlevelschange and modify the &Scale parameter in the img src appropriately.

···
Hi,
I want to consume the Geoserver data in the leaflet, someone has an example index.html where I can see the procedures.
If possible with presentation of the legend.
Best regards
–
Endi SoaresGeógrafo
m:(+238) 5809479
a:Praia, Cabo Verdee:
esoares.bvc.2016@…84… e: endy.soares89@…84…
![Image removed by sender.]()
In my experience figuring out this plugin is the way to go.
You can get the legend through getFeatureInfo.
https://github.com/heigeo/leaflet.wms
On Wed., Sep. 9, 2020, 5:11 p.m. Endi Soares, <endy.soares89@anonymised.com> wrote:
Hi,
I want to consume the Geoserver data in the leaflet, someone has an example index.html where I can see the procedures.
If possible with presentation of the legend.
Best regards
Endi SoaresGeógrafo
m:(+238) 5809479
a:Praia, Cabo Verdee:
esoares.bvc.2016@anonymised.com e: endy.soares89@anonymised.com

Geoserver-users mailing list
Please make sure you read the following two resources before posting to this list:
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
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Hi
I already have the layers on the WEBGIS page, the new challenge is to present the styles, present them in legend
I’m a little lost with that
Best Regards
···
Endi SoaresGeógrafo
m:(+238) 5809479
a:Praia, Cabo Verdee:
esoares.bvc.2016@anonymised.com e: endy.soares89@anonymised.com

This might help you out:
"<img src="+lyrurl+"SERVICE=wms&REQUEST=GetLegendGraphic&FORMAT=image/jpeg&WIDTH=20&HEIGHT=20&LEGEND_OPTIONS=forceLabels:on&LAYER="+lyrname+"&SCALE="+scale+"><br>"
Cheers,
Vera
On Thu, Sep 10, 2020 at 6:23 AM Endi Soares <endy.soares89@anonymised.com> wrote:
Hi
I already have the layers on the WEBGIS page, the new challenge is to present the styles, present them in legend
I’m a little lost with that
Best Regards
Em qui., 10 de set. de 2020 às 03:14, Vera Green <vera.green.ca@anonymised.com.84…> escreveu:
In my experience figuring out this plugin is the way to go.
You can get the legend through getFeatureInfo.
https://github.com/heigeo/leaflet.wms
On Wed., Sep. 9, 2020, 5:11 p.m. Endi Soares, <endy.soares89@anonymised.com> wrote:
Hi,
I want to consume the Geoserver data in the leaflet, someone has an example index.html where I can see the procedures.
If possible with presentation of the legend.
Best regards
Endi SoaresGeógrafo
m:(+238) 5809479
a:Praia, Cabo Verdee:
esoares.bvc.2016@anonymised.com e: endy.soares89@anonymised.com

Geoserver-users mailing list
Please make sure you read the following two resources before posting to this list:
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
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
–
Endi SoaresGeógrafo
m:(+238) 5809479
a:Praia, Cabo Verdee:
esoares.bvc.2016@anonymised.com e: endy.soares89@anonymised.com

I don’t think there is a “one-size-fits-all” solution to legends. The WMS getlegendgraphic call does all the work of getting you the image of the style to display, but you have to do the work with html and js of making dynamic legend containers. My effort are, for example: https://data.gns.cri.nz/tez/index.html?map=TEZ-Geoscience, but the same code drives many websites and maps so code rather too complex to be much help. It comes down to things like:
1/ is the legend container always displayed? or is displayed on demand.
2/ is legend graphic always displayed or only when layer is turned on? (in which case need to link the img visibility styling to mechanism for turning layers on/off).
3/ is legend always meaningful for all layers?
4/ how to handle really massive legends (ie NZ geology legend on that map is visible only as a pop-out graphic when show legend chosen from layer context menu – and that is the simple version. A full page one is coming up.)
If you look around web, there are many other solutions. Leaflet has a legend plugin which is all config driven but not useful in my opinion for WMS legend. You need to make some design decisions and then start coding. The geoserver component is simply the GetLegendGraphic call. Client-side questions would be better directed to more appropriate sources.

···
Hi
I already have the layers on the WEBGIS page, the new challenge is to present the styles, present them in legend
I’m a little lost with that
Best Regards
Em qui., 10 de set. de 2020 às 03:14, Vera Green <vera.green.ca@…84…> escreveu:
In my experience figuring out this plugin is the way to go.
You can get the legend through getFeatureInfo.
https://github.com/heigeo/leaflet.wms
On Wed., Sep. 9, 2020, 5:11 p.m. Endi Soares, <endy.soares89@…84…> wrote:
Hi,
I want to consume the Geoserver data in the leaflet, someone has an example index.html where I can see the procedures.
If possible with presentation of the legend.
Best regards
–
Endi SoaresGeógrafo
m:(+238) 5809479
a:Praia, Cabo Verdee:
esoares.bvc.2016@…84… e: endy.soares89@…84…
![Image removed by sender.]()
Geoserver-users mailing list
Please make sure you read the following two resources before posting to this list:
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
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
–
Endi SoaresGeógrafo
m:(+238) 5809479
a:Praia, Cabo Verdee:
esoares.bvc.2016@…84… e: endy.soares89@…84…
![Image removed by sender.]()