C# Класс 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.
Наследование: IProjectingProvider
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
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

Описание методов

AddLayer() публичный Метод

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
Результат void

AddStyle() публичный Метод

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
Результат void

Dispose() публичный Метод

public Dispose ( ) : void
Результат void

GetExtents() публичный Метод

public GetExtents ( ) : BoundingBox
Результат BoundingBox

GetFeaturesInView() публичный Метод

public GetFeaturesInView ( BoundingBox box, double resolution ) : IEnumerable
box BoundingBox
resolution double
Результат IEnumerable

GetLayer() публичный Метод

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
Результат Client.WmsServerLayer

GetLegendRequestUrls() публичный Метод

Gets the URL for a map request base on current settings, the image size and boundingbox
public GetLegendRequestUrls ( ) : IEnumerable
Результат IEnumerable

GetLegends() публичный Метод

public GetLegends ( ) : IEnumerable
Результат IEnumerable

GetRequestUrl() публичный Метод

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
Результат string

IsCrsSupported() публичный Метод

public IsCrsSupported ( string crs ) : bool?
crs string
Результат bool?

RemoveAllLayers() публичный Метод

Removes all layers
public RemoveAllLayers ( ) : void
Результат void

RemoveAllStyles() публичный Метод

Removes all styles from the list
public RemoveAllStyles ( ) : void
Результат void

RemoveLayer() публичный Метод

Removes a layer from the layer list
public RemoveLayer ( string name ) : void
name string Name of layer to remove
Результат void

RemoveLayerAt() публичный Метод

Removes the layer at the specified index
public RemoveLayerAt ( int index ) : void
index int
Результат void

RemoveStyle() публичный Метод

Removes a style from the collection
public RemoveStyle ( string name ) : void
name string Name of style
Результат void

RemoveStyleAt() публичный Метод

Removes a style at specified index
public RemoveStyleAt ( int index ) : void
index int Index
Результат void

SetImageFormat() публичный Метод

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
Результат void

TryGetMap() публичный Метод

public TryGetMap ( IViewport viewport, IRaster &raster ) : bool
viewport IViewport
raster IRaster
Результат bool

WmsProvider() публичный Метод

public WmsProvider ( XmlDocument capabilities, Func getStreamAsync = null ) : System
capabilities System.Xml.XmlDocument
getStreamAsync Func
Результат System

WmsProvider() публичный Метод

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
Результат System