Hi Scott,
Thanks, I hadn't actually installed the Services Edition, I was using the Core libraries from Web Edition.
I've now had a look at the webservices sample, and can see that it differs a lot from my code. So one doesn't need MapEngine at all, one just draws layers onto a GeoCanvas ?
However, my WMS layer still errs, so I don't have a working solution yet.
I've attached the error returned to my testing app.
I'm using a WMS service that is publically accessable for your convenience.
Here's the code for my service:
<WebMethod()> _
Public Function GetMapImage(ByVal request As GetMap_Request) As Byte()
'...
mapExtent = New RectangleShape(request.BoundingBox_LowerLeft.Easting, request.BoundingBox_UpperRight.Northing, request.BoundingBox_UpperRight.Easting, request.BoundingBox_LowerLeft.Northing)
myGeoImage = GdiPlusGeoCanvas.CreateGeoImage(request.ImageWidth, request.ImageHeight)
Dim myGdiPlusGeoCanvas As GdiPlusGeoCanvas = New GdiPlusGeoCanvas()
layer = WMS_Layer_Demo(mapExtent, request.ImageWidth, request.ImageHeight) '<<< Line 442
SyncLock layer
layer.Draw(myGdiPlusGeoCanvas, New Collection(Of SimpleCandidate)())
End SyncLock
'...
End Function
Here's the code for the WMS returning function in question:
Private Function WMS_Layer_Demo(ByVal mapExtent As RectangleShape, ByVal width As Double, ByVal height As Double) As WmsRasterLayer
Dim lyr As New WmsRasterLayer
Dim msg As String = "Init WMS_Layer_Demo"
'Valid GetMap URL: kort.arealinfo.dk/wms?service=wms&servicename=fyn_wms&VERSION=1.1.1&REQUEST=GetMap&LAYERS=420_40021_byzone_rp&SRS=EPSG:25832&format=image/GIF&WIDTH=800&HEIGHT=800&bbox=582700,6134800,592700,6144800
Try
msg = "Defining WMS uri"
lyr.Name = "Demo service"
lyr.Uri = New Uri("kort.arealinfo.dk/wms")
msg = "Defining WMS parameters"
lyr.Parameters.Add("servicename", "fyn_wms")
lyr.Parameters.Add("version", "1.1.1")
lyr.Parameters.Add("srs", "epsg:25832")
lyr.Parameters.Add("FORMAT", "image/jpeg")
lyr.OutputFormat = "image/jpeg"
lyr.Parameters.Add("BBOX", Extent2Bbox(mapExtent))
lyr.Parameters.Add("width", width)
lyr.Parameters.Add("height", height)
lyr.Parameters.Add("LAYERS", "420_40021_byzone_rp")
lyr.Parameters.Add("STYLES", "")
'
msg = "Opening WMS"
lyr.Open() '<<< THIS IS WHERE IT CRASHES
msg = "Returning WMS"
Return lyr
Catch ex As Exception
Throw New Exception("Cannot set base layer: DEMO" + vbCrLf + "Last: " + msg + vbCrLf + ex.Message) '<<< LINE 359
End Try
End Function
TIA