Skip to main content

MapSDK - Getting started

Installation

Before starting to develop your application with the WemapSDKs, you'll need to configure your credentials and add the SDK as a dependency.

Add the dependency

Add the WemapSDKs to your app

  • In your Podfile, add the WemapSDK pods that you want to use in your app.

    use_frameworks!

    target 'TargetNameOfYourApp' do
    pod 'WemapMapSDK', '<version>'
    end
  • Make sure that your project target this platform version or later:

    platform :ios, '12.0'
  • Install the pods, then open your .xcworkspace file to see the project in Xcode:

    AWS_ACCESS_KEY_ID=*** \
    AWS_SECRET_ACCESS_KEY=*** \
    AWS_REGION=*** \
    [bundle exec] pod install --repo-update
    open your-project.xcworkspace

Add a map

Open the view controller you’d like to add a map to and use the code below.

To make it work you should provide mapID and token to the mapData request.

import UIKit
import WemapMapSDK
import RxSwift

class ViewController: UIViewController {

private let disposeBag = DisposeBag()

override func viewDidLoad() {
super.viewDidLoad()

WemapMap.shared
.getMapData(mapID: 19158, token: "GUHTU6TYAWWQHUSR5Z5JZNMXX")
.subscribe(onSuccess: { [self] mapData in

let mapView = MapView(frame: view.bounds)
mapView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
mapView.mapData = mapData

view.addSubview(mapView)

}, onFailure: {
debugPrint("Failed to get map data with error - \($0)")
})
.disposed(by: disposeBag)
}
}

Examples

You can find additional examples for the WemapSDKs on GitHub. Clone the repository and run the example application following the instructions in the README.