I have geoserver and sharpmap and when I add one layer as tiled map it works perfect but when I want to add a group layer which contains several layers it shows nothing. this is my code:

    Dim Map As Map = New Map()
    Dim xmlDoc As New XmlDocument()
    Dim xDoc = Program.ConvertToXDocument(xmlDoc)
    Dim source As List(Of ITileSource)
    source = WmscTileSource.CreateFromWmscCapabilties((xDoc))
    Dim tileSource = source.FirstOrDefault(Function(x) x.Schema.Name = "GroupLayer")
    Dim TileLayer = New TileAsyncLayer(tileSource, "GroupLayer") With {.SRID = 4326}
    TileLayer.OnlyRedrawWhenComplete = True
    Mapbox1.PanOnClick = True

any suggestion?

Edit: Above code works for a single layer fine, but in geoserver I have several layers which added to a group layer, "GroupLayer". scale dependency is implemented in SLD files at Geoserver. The group is in finalCH workspace. As I know in sharpmap for tiled maps, you should download getcapabilities XML file and sharpmap will do the job with it. I have no problem to show the GroupLayer as single tile. my code for a single tile layer is different. I'm using SharpMap.WMSLayer for that:

        Dim wmsUrl As String = "" 
        'Adding Layers and Set Layers Properties
        Dim layWms As New WmsLayer("GroupLayer", wmsUrl)
        layWms.ContinueOnError = True
        layWms.TimeOut = 50000
        'set projection format
        layWms.SRID = 4326
        'force wms version
        layWms.Version = "1.1.0"
        'add layer to map
        Mapbox1.PanOnClick = True
        'set center of map to center of map box
        Dim env = New Envelope(44.0509701, 25.0652748, 63.3556599, 39.796795)
    Catch ex As Exception
    End Try
  • does it work for a single layer from the group? is there any scale dependency set on the layers? is there anything shown in the GeoServer log file? are you sure the groups is in the finalCH workspace? are you sure you want to request the capabilities and not a map? – Ian Turton Nov 16 '16 at 13:22
  • does the code above work for a single layer? – Ian Turton Nov 16 '16 at 13:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.