ArcGIS Runtime SDK for iOS
100.15
|
Displays data from a WMS service.
The service may be hosted in the cloud on ArcGIS Online, on a third party server, or on-premises with ArcGIS Server.
Web Map Service (WMS) is an Open Geospatial Consortium (OGC) standard for delivering map images from an online service. WMS layer displays data from a web service that provides maps in the form of server-rendered images. ArcGIS Runtime supports WMS versions 1.1.0, 1.1.1, and 1.3.0. The service may be hosted in the cloud on ArcGIS Online, on a third party server, or on-premises ArcGIS Server.
Functional characteristics A WMS service can contain multiple layers in a hierarchy. A WMS layer can be constructed directly with a URL to a service and the uniquely identifying name of the desired layer. Alternatively, an AGSWMSService
can be used to programmatically explore the available layers and allow the user to choose layers at run time.
The maps provided by a WMS service use predefined symbology defined by the server. As a result, it is not possible to apply custom renderers or to visualize feature selection. WMS layers can have multiple style options. Your app can choose from the available styles.
Some layers can be marked as opaque, which means that they cover most of the map area and are good candidates for use as a basemap.
WMS layers support identify and time. They do not support selection or query. Note that due to the nature of WMS, it is not possible to retrieve feature geometry from WMS identify results. WMS layers support custom parameters, which can be specified for the service or an individual layer.
Performance characteristics WMS servers render map images on demand, which can require more server resources than a similar tiled service. WMS requires a service connection at all times.
AGSLayer
, AGSImageAdjustmentLayer
, AGSWMSSublayer
, AGSWMSService
, Sample: WMS layer (URL) Instance Methods | |
(void) | - cancelLoad |
(void) | - doCancelLoading |
(void) | - doStartLoading: |
(id< AGSCancelable >) | - fetchLegendInfosWithCompletion: |
(instancetype) | - initWithItem: |
(instancetype) | - initWithLayerInfos: |
(instancetype) | - initWithURL:layerNames: |
(BOOL) | - isEqualToLayer: |
(BOOL) | - isVisibleAtScale: |
(void) | - loadDidFinishWithError: |
(void) | - loadWithCompletion: |
(void) | - onLoadStatusChanged |
(void) | - retryLoadWithCompletion: |
Class Methods | |
(instancetype) | + WMSLayerWithItem: |
(instancetype) | + WMSLayerWithLayerInfos: |
(instancetype) | + WMSLayerWithURL:layerNames: |
|
requiredinherited |
Cancels loading if it is in progress, otherwise it does nothing. This should be called carefully because other objects could be waiting for loadWithCompletion:
or retryLoadWithCompletion:
to complete and this will call them all back with the error of NSUserCancelledError
- (void) doCancelLoading |
Never call this method directly. The framework calls this method on a background thread when cancelLoad (AGSLoadable-p)
is called. It is meant to be overriden by subclasses. Subclasses should override this method to cancel loading their data and call loadDidFinishWithError: (AGSLoadableBase(ForSubclassEyesOnly))
at the end passing in an error representing NSUserCancelledError
.
Provided by category AGSLoadableBase(ForSubclassEyesOnly).
- (void) doStartLoading: | (BOOL) | retrying |
Never call this method directly. The framework calls this method on a background thread when loadWithCompletion: (AGSLoadable-p)
or retryLoadWithCompletion: (AGSLoadable-p)
is called. It is meant to be overriden by subclasses. Subclasses should override this method to load their data and call loadDidFinishWithError: (AGSLoadableBase(ForSubclassEyesOnly))
upon completion, passing in the error if any.
retrying | flag that is true if this method was called from retryLoadWithCompletion: (AGSLoadable-p) . |
Provided by category AGSLoadableBase(ForSubclassEyesOnly).
- (id<AGSCancelable>) fetchLegendInfosWithCompletion: | (void(^)(NSArray< AGSLegendInfo * > *__nullable legendInfos, NSError *__nullable error)) | completion |
Fetches the array of legend infos (AGSLegendInfo
) for this layer.
- (instancetype) initWithItem: | (AGSItem *) | item |
Initialize the layer with an item representing a WMS service. The item's type should be AGSPortalItemTypeWMS
.
item | representing a WMS service |
- (instancetype) initWithLayerInfos: | (NSArray< AGSWMSLayerInfo * > *) | layerInfos |
Initialize the layer with a collection of layers to render in the WMS service.
layerInfos | representing the layers to display |
- (instancetype) initWithURL: | (NSURL *) | URL | |
layerNames: | (NSArray< NSString * > *) | layerNames | |
Initialize the layer with a URL to a WMS service. The URL can be the GetCapabilities
URL for the service, for example - https://sampleserver6.arcgisonline.com/arcgis/services/SampleWorldCities/MapServer/WMSServer?request=GetCapabilities&service=WMS , or it could be a URL that just points to the service endpoint where the GetCapabilities
request can be issued, such as - https://sampleserver6.arcgisonline.com/arcgis/services/SampleWorldCities/MapServer/WMSServer.
Runtime supports WMS versions 1.3.0, 1.1.1, and 1.1.0. The latest supported WMS version is set as the default. To specify a preferred WMS version, set the VERSION
parameter in the GetCapabilities
URL for the service.
URL | to WMS layer |
layerNames | list of layers in the service to display |
- (BOOL) isEqualToLayer: | (AGSLayer *) | other |
- (BOOL) isVisibleAtScale: | (double) | scale |
Check whether this layer is visible at a given scale.
- (void) loadDidFinishWithError: | (nullable NSError *) | error |
Only subclasses should call this method in doStartLoading: (AGSLoadableBase(ForSubclassEyesOnly))
and doCancelLoading (AGSLoadableBase(ForSubclassEyesOnly))
when done loading or failed to load.
Provided by category AGSLoadableBase(ForSubclassEyesOnly).
|
requiredinherited |
Loads data for the object asynchronously. The completion block is invoked upon completion.
You can call this method any number of times, however only one attempt is made to load the data. If it is already loading, it will just continue to load (i.e. not force a reload). If it has already loaded successfully, the completion block will be invoked right away. If it has already failed to load, the completion block will be invoked right away with error previously encountered. This method supports multiple callers and will call them all back on completion. However, each caller's completion block will be invoked once and only once.
completion | block that is invoked when object loads successfully or fails to load. An error is passed to the block if the object fails to load. |
- cancelLoad
to cancel loading - retryLoadWithCompletion:
to force reload - (void) onLoadStatusChanged |
Never call this method directly. The framework calls this method on a background thread when AGSLoadable::loadStatus
changes is called. Subclasses can optionally implement this to know when their loading status has changed.
Provided by category AGSLoadableBase(ForSubclassEyesOnly).
|
requiredinherited |
Tries to reload when an object has failed to load. This method should be called judiciously. It should be called when:
cancelLoad
and then this methodIf the data hasn't started loading, it will start loading. If it is already loading, it will just continue to load. If it has already loaded successfully, calls back right away. If it has already failed to load, tries again. This method supports multiple callers and will call them all back on completion. However, each caller's completion block will be invoked once and only once.
completion | block that is invoked when object loads successfully or fails to load. An error is passed to the block if the object fails to load. |
+ (instancetype) WMSLayerWithItem: | (AGSItem *) | item |
Initialize the layer with an item representing a WMS service. The item's type should be AGSPortalItemTypeWMS
.
item | representing a WMS service |
+ (instancetype) WMSLayerWithLayerInfos: | (NSArray< AGSWMSLayerInfo * > *) | layerInfos |
Initialize the layer with a collection of layers to render in the WMS service.
layerInfos | representing the layers to display |
+ (instancetype) WMSLayerWithURL: | (NSURL *) | URL | |
layerNames: | (NSArray< NSString * > *) | layerNames | |
Initialize the layer with a URL to a WMS service. The URL can be the GetCapabilities
URL for the service, for example - https://sampleserver6.arcgisonline.com/arcgis/services/SampleWorldCities/MapServer/WMSServer?request=GetCapabilities&service=WMS , or it could be a URL that just points to the service endpoint where the GetCapabilities
request can be issued, such as - https://sampleserver6.arcgisonline.com/arcgis/services/SampleWorldCities/MapServer/WMSServer.
Runtime supports WMS versions 1.3.0, 1.1.1, and 1.1.0. The latest supported WMS version is set as the default. To specify a preferred WMS version, set the VERSION
parameter in the GetCapabilities
URL for the service.
URL | to WMS layer |
layerNames | list of layers in the service to display |
|
readnonatomiccopyinherited |
Attribution information of the layer.
|
readwritenonatomicassigninherited |
The brightness of the layer's map image. Default value is 0. Values in the range -100.0 to 100.0 are valid. Values outside that range are ignored.
|
readrequirednonatomicassigninherited |
Denotes whether the layer can change visibility or not.
|
readwritenonatomicassigninherited |
The contrast of the layer's map image. Default value is 0. Values in the range -100.0 to 100.0 are valid. Values outside that range are ignored.
|
readwritenonatomicstronginherited |
Security credentials to access the remote resource. Only applicable if the resource is secured.
|
readwritenonatomiccopy |
These parameters are appended to GetMap
and GetFeatureInfo
requests issued to the WMS service. If a parameter with the same name is defined in the service's custom parameters, then layer-specific values take precedence over service-wide values.
|
readnonatomicstronginherited |
Full extent of the layer.
|
readnonatomicstronginherited |
The full time extent of the layer 100.2
|
readwritenonatomicassigninherited |
The gamma of the layer's map image. Default value is 0. Values in the range -100.0 to 100.0 are valid. Values outside that range are ignored.
|
readnonatomicassigninherited |
Specifies whether the layer supports identify.
|
readnonatomicstronginherited |
The item the layer has been created from.
|
readwritenonatomiccopyinherited |
The layer's description.
|
readwritenonatomiccopyinherited |
The layer's ID specified in the web map item of ArcGIS Online or an on-premises portal.
|
readnonatomicstrong |
A collection of layer info objects representing the layers in the WMS service
|
readnonatomicstrong |
Names of layers in the WMS service
|
readnonatomicstronginherited |
The error that was encountered during the most recent load operation. Will be nil if the operation succeeded.
|
readrequirednonatomicassigninherited |
Status of the load operation.
|
readwritenonatomicassigninherited |
The maximum scale at which this layer is visible. If the map or scene is zoomed in beyond this scale, the layer will not be visible. A value of 0
means there is no maximum scale threshold and the layer will be visible at the smallest scale available for the map or scene.
|
readwritenonatomicassigninherited |
The minimum scale at which this layer is visible. If the map or scene is zoomed out. beyond this scale, the layer will not be visible. A value of 0
means there is no minimum scale threshold and the layer will be visible at the largest scale available for the map or scene.
|
readwritenonatomiccopyinherited |
The name of the layer.
|
readwritenonatomicassigninherited |
The opacity of this layer as a value between 0 (fully transparent) and 1 (fully opaque). Default value is 1.
|
readwritenonatomicassign |
The preferred image format for rendering the layer
|
readwritenonatomicassign |
Time interval (in seconds) specifying how often the layer should auto-refresh its contents. If 0 or less is specified, the layer will not auto-refresh.
|
readwritenonatomicstronginherited |
The AGSRequestConfiguration object which defines the behavior and policies to use when accessing the remote resource. The default will be nil. If it is nil the [AGSRequestConfiguration globalConfiguration] will be used.
|
readwritenonatomicassigninherited |
Indicates whether to show legend information.
|
readnonatomicstronginherited |
The spatial reference of the layer.
|
readnonatomiccopyinherited |
This layer's sub-layers.
|
readwritenonatomiccopyinherited |
Block that is invoked when the sub layer contents changes.
|
readnonatomicstrong |
A collection of sublayers, one for each layer in the WMS service that is represented in layerInfos
.
|
readnonatomicassigninherited |
Indicates whether the layer supports filtering its contents by a time range 100.2
|
readwritenonatomicassigninherited |
Indicates whether the layer must use the time extent defined on the owning AGSGeoView::timeExtent
and filter its content. Only applicable if the layer supports time filtering (see supportsTimeFiltering
) 100.2
|
readnonatomicstronginherited |
Returns the suggested time slider step size for this time aware layer. Can be nil
if no time interval is suggested for this time aware object.
100.2
|
readwritenonatomicstronginherited |
A time offset for this layer. This is useful when data from different layers belong to different time periods and must be displayed together. The offset it applied on-the-fly, it does not change the actual data of the layer. The time offset is subtracted from the time extent set on the owning AGSGeoView::timeExtent
before the extent is used to filter content from the layer. 100.2
|
readrequirednonatomicstronginherited |
The URL of the remote resource.
|
readnonatomicassign |
The version of the WMS layer. Runtime supports WMS versions 1.3.0, 1.1.1, and 1.1.0. The latest supported WMS version is set as the default. To specify a preferred WMS version, set the VERSION
parameter in the GetCapabilities
URL for the service.
|
readwritenonatomicassigninherited |
Denotes whether the layer is visible or not. The visibility changes can be monitored using Key-Value Observing (KVO).