C# Class Mapsui.Providers.Wms.WmsProvider

Web Map Service layer
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.
Inheritance: IProjectingProvider
Mostrar archivo Open project: pauldendulk/Mapsui Class Usage Examples

Public Methods

Method Description
AddLayer ( string name ) : void

Adds a layer to WMS request

Layer names are case sensitive.

AddStyle ( string name ) : void

Adds a style to the style collection

Dispose ( ) : void
GetExtents ( ) : BoundingBox
GetFeaturesInView ( BoundingBox box, double resolution ) : IEnumerable
GetLayer ( string name ) : Client.WmsServerLayer

Get a layer from the WMS

Layer names are case sensitive.

GetLegendRequestUrls ( ) : IEnumerable

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

GetLegends ( ) : IEnumerable
GetRequestUrl ( BoundingBox box, int width, int height ) : string

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

IsCrsSupported ( string crs ) : bool?
RemoveAllLayers ( ) : void

Removes all layers

RemoveAllStyles ( ) : void

Removes all styles from the list

RemoveLayer ( string name ) : void

Removes a layer from the layer list

RemoveLayerAt ( int index ) : void

Removes the layer at the specified index

RemoveStyle ( string name ) : void

Removes a style from the collection

RemoveStyleAt ( int index ) : void

Removes a style at specified index

SetImageFormat ( string mimeType ) : void

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

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

TryGetMap ( IViewport viewport, IRaster &raster ) : bool
WmsProvider ( XmlDocument capabilities, Func getStreamAsync = null ) : System
WmsProvider ( string url, string wmsVersion = null, Func getStreamAsync = null ) : System

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

Private Methods

Method Description
FindLayer ( Client layer, string name, Client &result ) : bool
GetPreferredMethod ( ) : Client.WmsOnlineResource
GetStreamAsync ( string url ) : Task
InitialiseGetStreamAsyncMethod ( Func getStreamAsync ) : void
LayerExists ( Client layer, string name ) : bool

Recursive method for checking whether a layername exists

StyleExists ( Client layer, string name ) : bool

Recursive method for checking whether a layername exists

WmsProvider ( Client wmsClient, Func getStreamAsync = null ) : System

Method Details

AddLayer() public method

Adds a layer to WMS request
Layer names are case sensitive.
Throws an exception is an unknown layer is added
public AddLayer ( string name ) : void
name string Name of layer
return void

AddStyle() public method

Adds a style to the style collection
Throws an exception is an unknown layer is added
public AddStyle ( string name ) : void
name string Name of style
return void

Dispose() public method

public Dispose ( ) : void
return void

GetExtents() public method

public GetExtents ( ) : BoundingBox
return BoundingBox

GetFeaturesInView() public method

public GetFeaturesInView ( BoundingBox box, double resolution ) : IEnumerable
box BoundingBox
resolution double
return IEnumerable

GetLayer() public method

Get a layer from the WMS
Layer names are case sensitive.
Throws an exception if the layer is not found
public GetLayer ( string name ) : Client.WmsServerLayer
name string Name of layer
return Client.WmsServerLayer

GetLegendRequestUrls() public method

Gets the URL for a map request base on current settings, the image size and boundingbox
public GetLegendRequestUrls ( ) : IEnumerable
return IEnumerable

GetLegends() public method

public GetLegends ( ) : IEnumerable
return IEnumerable

GetRequestUrl() public method

Gets the URL for a map request base on current settings, the image size and boundingbox
public GetRequestUrl ( BoundingBox box, int width, int height ) : string
box BoundingBox
width int
height int
return string

IsCrsSupported() public method

public IsCrsSupported ( string crs ) : bool?
crs string
return bool?

RemoveAllLayers() public method

Removes all layers
public RemoveAllLayers ( ) : void
return void

RemoveAllStyles() public method

Removes all styles from the list
public RemoveAllStyles ( ) : void
return void

RemoveLayer() public method

Removes a layer from the layer list
public RemoveLayer ( string name ) : void
name string Name of layer to remove
return void

RemoveLayerAt() public method

Removes the layer at the specified index
public RemoveLayerAt ( int index ) : void
index int
return void

RemoveStyle() public method

Removes a style from the collection
public RemoveStyle ( string name ) : void
name string Name of style
return void

RemoveStyleAt() public method

Removes a style at specified index
public RemoveStyleAt ( int index ) : void
index int Index
return void

SetImageFormat() public method

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

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

Throws an exception if either the mime type isn't offered by the WMS /// or GDI+ doesn't support this mime type.
public SetImageFormat ( string mimeType ) : void
mimeType string Mime type of image format
return void

TryGetMap() public method

public TryGetMap ( IViewport viewport, IRaster &raster ) : bool
viewport IViewport
raster IRaster
return bool

WmsProvider() public method

public WmsProvider ( XmlDocument capabilities, Func getStreamAsync = null ) : System
capabilities System.Xml.XmlDocument
getStreamAsync Func
return System

WmsProvider() public method

Initializes a new layer, and downloads and parses the service description
public WmsProvider ( string url, string wmsVersion = null, Func getStreamAsync = null ) : System
url string Url of WMS server
wmsVersion string Version number of wms leave null to get the default service version
getStreamAsync Func Download method, leave null for default
return System