Show / Hide Table of Contents

    Class WmsProvider

    Web Map Service layer

    Inheritance
    System.Object
    WmsProvider
    Implements
    IProjectingProvider
    IProvider
    Namespace: Mapsui.Desktop.Wms
    Assembly: Mapsui.Desktop.dll
    Syntax
    public class WmsProvider : object, IProjectingProvider, IProvider
    Remarks

    The WmsLayer is currently very basic and doesn't support automatic fetching of the WMS Service Description. Instead you would have to add the nessesary parameters to the URL, and the WmsLayer will set the remaining BoundingBox property and proper requests that changes between the requests. See the example below.

    Constructors

    | Improve this Doc View Source

    WmsProvider(String, String, Func<String, Task<Stream>>)

    Initializes a new layer, and downloads and parses the service description

    Declaration
    public WmsProvider(string url, string wmsVersion = null, Func<string, Task<Stream>> getStreamAsync = null)
    Parameters
    Type Name Description
    System.String url

    Url of WMS server

    System.String wmsVersion

    Version number of wms leave null to get the default service version

    Func<System.String, Task<Stream>> getStreamAsync

    Download method, leave null for default

    | Improve this Doc View Source

    WmsProvider(XmlDocument, Func<String, Task<Stream>>)

    Declaration
    public WmsProvider(XmlDocument capabilities, Func<string, Task<Stream>> getStreamAsync = null)
    Parameters
    Type Name Description
    XmlDocument capabilities
    Func<System.String, Task<Stream>> getStreamAsync

    Properties

    | Improve this Doc View Source

    ContinueOnError

    Specifies whether to throw an exception if the Wms request failed, or to just skip rendering the layer

    Declaration
    public bool ContinueOnError { get; set; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Credentials

    Provides the base authentication interface for retrieving credentials for Web client authentication.

    Declaration
    public ICredentials Credentials { get; set; }
    Property Value
    Type Description
    ICredentials
    | Improve this Doc View Source

    CRS

    Declaration
    public string CRS { get; set; }
    Property Value
    Type Description
    System.String
    | Improve this Doc View Source

    ExtraParams

    Declaration
    public Dictionary<string, string> ExtraParams { get; set; }
    Property Value
    Type Description
    Dictionary<System.String, System.String>
    | Improve this Doc View Source

    GetFeatureInfoFormats

    Gets the list of available FeatureInfo Output Format

    Declaration
    public Collection<string> GetFeatureInfoFormats { get; }
    Property Value
    Type Description
    Collection<System.String>
    | Improve this Doc View Source

    LayerList

    Gets the list of enabled layers

    Declaration
    public Collection<string> LayerList { get; }
    Property Value
    Type Description
    Collection<System.String>
    | Improve this Doc View Source

    OutputFormats

    Gets the list of available formats

    Declaration
    public Collection<string> OutputFormats { get; }
    Property Value
    Type Description
    Collection<System.String>
    | Improve this Doc View Source

    RootLayer

    Gets the hiarchial list of available WMS layers from this service

    Declaration
    public Client.WmsServerLayer RootLayer { get; }
    Property Value
    Type Description
    Client.WmsServerLayer
    | Improve this Doc View Source

    ServiceDescription

    Gets the service description from this server

    Declaration
    public Capabilities.WmsServiceDescription ServiceDescription { get; }
    Property Value
    Type Description
    Capabilities.WmsServiceDescription
    | Improve this Doc View Source

    StylesList

    Gets the list of enabled styles

    Declaration
    public Collection<string> StylesList { get; }
    Property Value
    Type Description
    Collection<System.String>
    | Improve this Doc View Source

    TimeOut

    Timeout of webrequest in milliseconds. Defaults to 10 seconds

    Declaration
    public int TimeOut { get; set; }
    Property Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    Version

    Gets the WMS Server version of this service

    Declaration
    public string Version { get; }
    Property Value
    Type Description
    System.String

    Methods

    | Improve this Doc View Source

    AddLayer(String)

    Adds a layer to WMS request

    Declaration
    public void AddLayer(string name)
    Parameters
    Type Name Description
    System.String name

    Name of layer

    Remarks

    Layer names are case sensitive.

    | Improve this Doc View Source

    AddStyle(String)

    Adds a style to the style collection

    Declaration
    public void AddStyle(string name)
    Parameters
    Type Name Description
    System.String name

    Name of style

    | Improve this Doc View Source

    Dispose()

    Declaration
    public void Dispose()
    | Improve this Doc View Source

    GetExtents()

    Declaration
    public BoundingBox GetExtents()
    Returns
    Type Description
    BoundingBox
    | Improve this Doc View Source

    GetFeaturesInView(BoundingBox, Double)

    Declaration
    public IEnumerable<IFeature> GetFeaturesInView(BoundingBox box, double resolution)
    Parameters
    Type Name Description
    BoundingBox box
    System.Double resolution
    Returns
    Type Description
    IEnumerable<IFeature>
    | Improve this Doc View Source

    GetLayer(String)

    Get a layer from the WMS

    Declaration
    public Client.WmsServerLayer GetLayer(string name)
    Parameters
    Type Name Description
    System.String name

    Name of layer

    Returns
    Type Description
    Client.WmsServerLayer
    Remarks

    Layer names are case sensitive.

    | Improve this Doc View Source

    GetLegendRequestUrls()

    Gets the URL for a map request base on current settings, the image size and boundingbox

    Declaration
    public IEnumerable<string> GetLegendRequestUrls()
    Returns
    Type Description
    IEnumerable<System.String>

    URL for WMS request

    | Improve this Doc View Source

    GetLegends()

    Declaration
    public IEnumerable<MemoryStream> GetLegends()
    Returns
    Type Description
    IEnumerable<MemoryStream>
    | Improve this Doc View Source

    GetRequestUrl(BoundingBox, Int32, Int32)

    Gets the URL for a map request base on current settings, the image size and boundingbox

    Declaration
    public string GetRequestUrl(BoundingBox box, int width, int height)
    Parameters
    Type Name Description
    BoundingBox box
    System.Int32 width
    System.Int32 height
    Returns
    Type Description
    System.String

    URL for WMS request

    | Improve this Doc View Source

    IsCrsSupported(String)

    Declaration
    public bool? IsCrsSupported(string crs)
    Parameters
    Type Name Description
    System.String crs
    Returns
    Type Description
    System.Nullable<System.Boolean>
    | Improve this Doc View Source

    RemoveAllLayers()

    Removes all layers

    Declaration
    public void RemoveAllLayers()
    | Improve this Doc View Source

    RemoveAllStyles()

    Removes all styles from the list

    Declaration
    public void RemoveAllStyles()
    | Improve this Doc View Source

    RemoveLayer(String)

    Removes a layer from the layer list

    Declaration
    public void RemoveLayer(string name)
    Parameters
    Type Name Description
    System.String name

    Name of layer to remove

    | Improve this Doc View Source

    RemoveLayerAt(Int32)

    Removes the layer at the specified index

    Declaration
    public void RemoveLayerAt(int index)
    Parameters
    Type Name Description
    System.Int32 index
    | Improve this Doc View Source

    RemoveStyle(String)

    Removes a style from the collection

    Declaration
    public void RemoveStyle(string name)
    Parameters
    Type Name Description
    System.String name

    Name of style

    | Improve this Doc View Source

    RemoveStyleAt(Int32)

    Removes a style at specified index

    Declaration
    public void RemoveStyleAt(int index)
    Parameters
    Type Name Description
    System.Int32 index

    Index

    | Improve this Doc View Source

    SetImageFormat(String)

    Sets the image type to use when requesting images from the WMS server

    Declaration
    public void SetImageFormat(string mimeType)
    Parameters
    Type Name Description
    System.String mimeType

    Mime type of image format

    Remarks

    See the OutputFormats property for a list of available mime types supported by the WMS server

    | Improve this Doc View Source

    TryGetMap(IViewport, ref IRaster)

    Declaration
    public bool TryGetMap(IViewport viewport, ref IRaster raster)
    Parameters
    Type Name Description
    IViewport viewport
    IRaster raster
    Returns
    Type Description
    System.Boolean

    Implements

    IProjectingProvider
    IProvider
    • Improve this Doc
    • View Source
    Back to top Generated by DocFX