4

Knows somebody a book or an example/tutorial to implement an WMS service in Swift? The layer need zoomable with the map.

I'm having a WMS service in Android and I read the tutorial: MapKit Tutorial: Overlay Views

but I'm a beginner in Swift and I don't know how to integrate it. Thanks a lot.

Here the 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 are the dynamic BBOX in the url, with the correct x, y and zoom.

The result: Screenshot

Oliver Nass
  • 59
  • 1
  • 3

0 Answers0