Mapping SDK 3.0 Integration Guide (iOS)
Mapping Setup and Prerequisites
iOS Managed Provider Setup
PWMapKit
has a dependency on thePWCore
andPWLocation
frameworks.
- Phunware recommends using CocoaPods to integrate the framework. Simply add
pod 'PWMapKit'
to your podfile. - Alternatively, all of the following frameworks can be added to the Vendor/Phunware directory of your project:
- PWMapKit.framework
- PWCore.framework
- PWLocation.framework
- Initialize Cocoapods if your project does not already use it. If your environment does not already have Cocoapods installed, enter "sudo gem install cocoapods" in Terminal. After Cocoapods is installed, navigate to your project's root directory in the Terminal. Enter "pod init" in Terminal.
- In the Podfile file that is generated, modify the text in Xcode or your preferred text editor. Add the line "pod 'PWMapKit'" after the "target" line and before the "end" line. Save the file.
- Enter "pod install" in Terminal while in the directory that contains the Podfile.
- Use the .xcworkspace file that was generated by the pod install from now on.
- In your project's Info.plist file, add a row with key: "Privacy - Location When In Use Usage Description" (Xcode should autocomplete this) and for value, add what you want your users to see when prompted for Location use by the device.
Additional Documentation
Attribution
- Framework documentation is included in the the repository's
Documents
folder in both HTML and Docset formats. - API documentation online
- LBS (Mapping) Configuration Guide 1.0
- Developing Accessible Apps
PWMapKit uses the following third-party components. All components are prefixed so you don't have to worry about namespace collisions.
Component | Description | License |
---|---|---|
SVPulsingAnnotationView | A customizable MKUserLocationView replica for your iOS app. | MIT |
Sample Application
The framework comes with a ready-to-use sample application. In order to use this application you will need to update the configuration with your MaaS credentials and location provider information.
- Update your MaaS credentials and set up the building identifier in
BuildingConfiguration.plist
.
Usage
Register Location Provider
Indoor Location
Routing for iOS Mapping
Calculate Route
Current Route Updates
Displaying your Map
Showing Current Location on the Map
This will display your current location on your building map if the MaaS and hardware were also configured properly. If you encounter issues, create the PWManagedLocationManager as a property and assign its delegate to your view controller rather than calling registerLocationManager on the PWMapView. The error may then be captured with the PWLocationManagerDelegate callback function "- (void)locationManager:(id<PWLocationManager>)manager failedWithError:(NSError *)error;"