MaplyWMSTileSource
Objective-C
@interface MaplyWMSTileSource : NSObject <MaplyTileInfoNew>
Swift
class MaplyWMSTileSource : NSObject, MaplyTileInfoNew
This is a MaplyTileSource that works with a remote Web Map Service implementation. WMS is not the most efficient way to access remote image data, but there are still a few places that use it.
-
Base URL for the Map Service
Declaration
Objective-C
@property (nonatomic, strong, nullable) NSString *baseURL;
Swift
var baseURL: String? { get set }
-
Capabilities describing the service
Declaration
Objective-C
@property (nonatomic, strong, nullable) MaplyWMSCapabilities *capabilities;
Swift
var capabilities: MaplyWMSCapabilities? { get set }
-
Image type to request
Declaration
Objective-C
@property (nonatomic, strong, nullable) NSString *imageType;
Swift
var imageType: String? { get set }
-
Layer we’re grabbing
Declaration
Objective-C
@property (nonatomic, strong, nonnull) MaplyWMSLayer *layer;
Swift
var layer: MaplyWMSLayer { get set }
-
Optional style we’re using
Declaration
Objective-C
@property (nonatomic, strong, nonnull) MaplyWMSStyle *style;
Swift
var style: MaplyWMSStyle { get set }
-
Minimum zoom level we’ll expect
Declaration
Objective-C
@property (nonatomic, readonly) int minZoom;
Swift
var minZoom: Int32 { get }
-
Maximum zoom level we’ll expect
Declaration
Objective-C
@property (nonatomic, readonly) int maxZoom;
Swift
var maxZoom: Int32 { get }
-
Tile size provided to caller
Declaration
Objective-C
@property (nonatomic, readonly) int tileSize;
Swift
var tileSize: Int32 { get }
-
If set we’ll ask for a transparent background from the server
Declaration
Objective-C
@property (nonatomic) _Bool transparent;
Swift
var transparent: Bool { get set }
-
Coordinate system (used to build URLs)
Declaration
Objective-C
@property (nonatomic, readonly, nonnull) MaplyCoordinateSystem *coordSys;
Swift
var coordSys: MaplyCoordinateSystem { get }
-
If set, we’ll cache the images locally (a good idea with WMS)
Declaration
Objective-C
@property (nonatomic, strong, nullable) NSString *cacheDir;
Swift
var cacheDir: String? { get set }
-
Initialize with the parameters the WMS server is going to want.
- parameter: baseURL The main URL we'll use to construct queries. - parameter: cap The capabilities as parsed from the service. - parameter: layer The layer we'll access. There can be multiple and it's up to you to pick one. - parameter: style The style variant of the layer we want. Again there can be multiple and it's up to you to pick. - parameter: coordSys The coordinate system we're expecting to work in. - parameter: minZoom The min zoom level we want. Note that WMS doesn't handle this directly. Our tile source just controls what areas it asks for based on the overall extents and the zoom levels. - parameter: maxZoom The max zoom level we'll query.
Declaration
Objective-C
- (nullable instancetype)initWithBaseURL:(NSString *_Nonnull)baseURL capabilities:(MaplyWMSCapabilities *_Nullable)cap layer:(MaplyWMSLayer *_Nonnull)layer style:(MaplyWMSStyle *_Nonnull)style coordSys: (MaplyCoordinateSystem *_Nonnull)coordSys minZoom:(int)minZoom maxZoom:(int)maxZoom tileSize:(int)tileSize;
Swift
init?(baseURL: String, capabilities cap: MaplyWMSCapabilities?, layer: MaplyWMSLayer, style: MaplyWMSStyle, coordSys: MaplyCoordinateSystem, minZoom: Int32, maxZoom: Int32, tileSize: Int32)