# Loding WMS Layer

**URL:** <https://mapwindow.discourse.group/t/loding-wms-layer/611>\
**Category:** MapWinGIS\
**Created:** [June 10, 2020, 3:43pm UTC](https://mapwindow.discourse.group/t/loding-wms-layer/611 "2020-06-10T15:43:31Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![jTati](https://avatars.discourse-cdn.com/v4/letter/j/977dab/32.png) [@jTati](https://mapwindow.discourse.group/u/jTati)\
**Post date:** [November 19, 2020, 1:18pm UTC](https://mapwindow.discourse.group/t/loding-wms-layer/611/12 "2020-11-19T13:18:05Z")

</div>

Hi Jerry,  
Hi dimpflmoser (aka Hotzenplotz-Hunter 😉

I played around with your code and found a working solution in VBA:

##############

```
Map0.TileProvider = MapWinGIS.tkTileProvider.ProviderNone
Map0.Projection = tkMapProjection.PROJECTION_WGS84

Set objWmsLayer = New MapWinGIS.WmsLayer
Set objExtents = New MapWinGIS.Extents

objExtents.SetBounds 10.98326, 48.69167, 0, 11.0237, 48.72229, 0

objWmsLayer.BaseUrl = "https://www.lfu.bayern.de/gdi/wms/wasser/ueberschwemmungsgebiete"
objWmsLayer.BoundingBox = objExtents
objWmsLayer.DoCaching = False
objWmsLayer.Epsg = 4326
objWmsLayer.Format = "image/png32"
objWmsLayer.Layers = "hwgf_hqhaeufig"
objWmsLayer.Name = "Hochwassergefahrenfl?chen HQh?ufig"
objWmsLayer.Opacity = 63
objWmsLayer.UseCache = False
objWmsLayer.TransparentColor = 255
objWmsLayer.UseTransparentColor = True
objWmsLayer.Version = wv13

intLayerHandle = Me.Map0.AddLayer(objWmsLayer, True)
Me.Map0.LayerVisible intLayerHandle, True

Set Me.Map0.Extents = objExtents
Me.Map0.MoveTo 10.9833, 48.6918
Me.Map0.Redraw

```

################

It is quite usefull to log the WMS/Tile-Requests of MapWinGIS with:

Dim myGlobalSettings As MapWinGIS.GlobalSettings

If (myGlobalSettings Is Nothing) Then Set myGlobalSettings = New MapWinGIS.GlobalSettings

myGlobalSettings.LogTileErrorsOnly = True  
Call myGlobalSettings.StartLogTileRequests(strPath + strTILE\_LOG\_FILE)

–\> where strPath & strTILE\_LOG\_FILE need to be defined.

Here i figuerd out, that

- the WMS-Version needs to be set, to get the CRS-Parameter used by MapWinGis compatible to this specific WMS-Server.

Hope this works for you as well.

Stay healthy and have fun.

Ciao  
Stefan

---

_[View the full topic](https://mapwindow.discourse.group/t/loding-wms-layer/611)._
