Skip to content
Discussion options

You must be logged in to vote

You can use the Map.add_image() function to add the legend.

import leafmap

m = leafmap.Map()
hrvlcc_url = "https://geoserver.vlcc.geoville.com/geoserver/ows?"
m.add_wms_layer(
    url=hrvlcc_url, layers="HRL_CPL:CTY_S2017", name="CTY 2017", format="image/png", shown=True
)
legend_url = 'https://geoserver.vlcc.geoville.com/geoserver/ows?service=WMS&version=1.3.0&request=GetLegendGraphic&format=image/png&width=20&height=20&layer=HRL_CPL:CTY_S2017'
m.add_image(legend_url)
m

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by giswqs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants