Dim CustomUrlTileProvider2 As CustomUrlTileProvider
'after that inside Mapfragment_ready
Dim TileOverlayOptions2 As TileOverlayOptions
CustomUrlTileProvider2.Initialize("WMS",256,256)
TileOverlayOptions2.Initialize
TileOverlayOptions2.SetTileProvider(CustomUrlTileProvider2)
TileOverlay2=GoogleMapsExtras1.AddTileOverlay(GoogleMap1, TileOverlayOptions2)
''and the sub that M6SOFT wrote is something like this
Sub WMS_GetTileURL(TileX As Int, TileY As Int, Zoom As Int) As String
Dim baseURL,format1,layers,styles,srs As String
Dim url As String
Dim n As Double
Dim nn1 As Double
Dim lat As Double
Dim lon As Double
Dim lat1 As Double
Dim lon1 As Double
Dim bound As String
n = Power(2, Zoom)
nn1=cPI * (1 - 2 * TileY / n)
lat=180/cPI*(ATan((Power(cE,nn1)-Power(cE, (-nn1)))/2))
nn1=cPI * (1 - 2 * (TileY+1) / n)
lat1=180/cPI*(ATan((Power(cE,nn1)-Power(cE, (-nn1)))/2))
lon=TileX / n * 360.0 - 180.0
lon1=(TileX+1) / n * 360.0 - 180.0
bound=lon & "," & lat1 & "," & lon1 & "," & lat
baseURL = "http://gis.ktimanet.gr/wms/wmsopen/wmsserver.aspx?"
format1 = "image/png" '; //Type of image returned
layers = "THE BASEMAP OF KTIMATOLOGIO" '; //WMS layers To display
styles = ""'; //styles To use For the layers
srs = "EPSG:4326"'; //Projection To display.
url = baseURL & "version=1.1.1&SERVICE=WMS&request=GetMap&Layers=" & layers & "&Styles=" & styles & "&SRS=" & srs & "&BBOX=" & bound & "&width=256&height=256&format=" & format1 & "&transparent=true"
Log (url)
Return url
End Sub