from owslib.wms import WebMapService from folium import Map, raster_layers, LayerControl # Prepare the Web Map Service wms = WebMapService('https://geoservice.norderstedt.de/geoserver/pub/eLadestation/wms', version='1.3.0') # Print information about the Web Map Service print(f"WMS version: {wms.identification.version}") print(f"WMS title: {wms.identification.title}") print(f"Provider name: {wms.provider.name}") # Get the Layers offered by the Web Map Service layers = list(wms.contents.keys()) print("Layers: ", layers) # Get the bounding box of the map of the first layer bbox = wms.contents[layers[0]].boundingBox # Calculate the center of the bounding box center= ( bbox[1]+((bbox[3]-bbox[1]) / 2), bbox[0]+((bbox[2]-bbox[0]) / 2)) # Create the underlying Map m = Map( location=center, zoom_start=10, tiles="cartodb positron") # Add the first layer to the map (Orthophotos of Norderstedt) raster_layers.WmsTileLayer( url='https://geoservice.norderstedt.de/geoserver/dop/dop2020sw/wms', layers='dop2020sw', fmt='image/png', transparent=True, name='Norderstedt Statdgebiet', control=True, overlay=True, show=True ).add_to(m) # Add the second layer to the map (markers of eLadestationen) raster_layers.WmsTileLayer( url='https://geoservice.norderstedt.de/geoserver/pub/eLadestation/wms', layers='eLadestation', fmt='image/png', transparent=True, name='E Ladestation', control=True, overlay=True, show=True ).add_to(m) # Add a Control Panel to the top right to modify the shown Layers LayerControl().add_to(m) m.save("output.html")