WMS service with Swift / iOS

Knows anyone a book or example / tutorial on how to implement a WMS service in Swift? The layer needs to be scaled using the map.

I have a WMS service on Android and I am reading a tutorial: MapKit Tutorial: Overlay Views

but i am new to Swift and i dont know how to integrate it. Many thanks.

Here's some sample code:

    let url = "https://geoserver/wms?LAYERS=Karte&STYLES=&SERVICE=WMS&VERSION=1.3&REQUEST=GetMap&SRS=EPSG:900913&BBOX=464201.39551181,5902292.6044465,1836379.4732096,7388629.6749115&width=256&height=256&format=image/png8&transparent=true"

    var overlay = MyTileOverlay(URLTemplate:url)
    self.mapView.addOverlay(overlay)



class MyTileOverlay : MKTileOverlay {
var alpha: CGFloat = 1.0

 func URLForTilePath(path: MKTileOverlayPath,
    result: ((NSData!, NSError!) -> Void)!) {

        super.loadTileAtPath(path, result) } }

      

The problem is dynamic BBOX in url with correct x, y and scaling.

Result: Screenshot

+3


source to share





All Articles