POST
|
I deleted the app off the simulator and cleaned it. Not getting any results yet. Below is my updated code. import UIKit import ArcGIS import CoreLocation class MapViewController: UIViewController, AGSCalloutDelegate, AGSMapViewLayerDelegate, AGSWebMapDelegate,CLLocationManagerDelegate { @IBOutlet weak var mapView: AGSMapView! let webMap = AGSWebMap(itemId: "f553d4b86e354c05917ad269de26f6f0", credential: nil) override func viewDidLoad() { super.viewDidLoad() self.webMap.openIntoMapView(self.mapView) self.webMap.delegate = self } func webMapViewDidLoad(mapView: AGSWebMap!) { self.mapView.locationDisplay.startDataSource() } func webMapDidLoad(webMap: AGSWebMap!) { print("Web Map Loaded") } func didOpenWebMap(webMap: AGSWebMap!, intoMapView mapView: AGSMapView!) { print("Opened the Web Map into the Map View") } func webMap(webMap: AGSWebMap!, didLoadLayer layer: AGSLayer!) { print("Loaded layer \(layer.name)") } func webMapView(webMap: AGSWebMap!, didFailToLoadWithError error: NSError!) { print("Layer failed to load into Web Map! \(error.localizedDescription)") } }
... View more
09-06-2016
07:28 PM
|
0
|
1
|
460
|
POST
|
Im running a web map on my ios app using Swift but am unable to get the current location once the map loads. I've also made sure to add NSLocationWhenInUseUsageDescription in the Info.plist file. Below is the code I'm working with. import UIKit import ArcGIS import CoreLocation class MapViewController: UIViewController, AGSCalloutDelegate, AGSMapViewLayerDelegate, AGSWebMapDelegate, CLLocationManagerDelegate { @IBOutlet weak var mapView: AGSMapView! let webMap = AGSWebMap(itemId: "f553d4b86e354c05917ad269de26f6f0", credential: nil) var locationManager = CLLocationManager() override func viewDidLoad() { super.viewDidLoad() self.webMap.openIntoMapView(self.mapView) self.webMap.delegate = self locationManager = CLLocationManager() locationManager.delegate = self locationManager.desiredAccuracy = kCLLocationAccuracyBest locationManager.startUpdatingLocation() locationManager.requestWhenInUseAuthorization() } func webMapViewDidLoad(mapView: AGSWebMap!) { self.mapView.locationDisplay.startDataSource() } func webMapDidLoad(webMap: AGSWebMap!) { print("Web Map Loaded") } func didOpenWebMap(webMap: AGSWebMap!, intoMapView mapView: AGSMapView!) { print("Opened the Web Map into the Map View") } func webMap(webMap: AGSWebMap!, didLoadLayer layer: AGSLayer!) { print("Loaded layer \(layer.name)") } func webMapView(webMap: AGSWebMap!, didFailToLoadWithError error: NSError!) { print("Layer failed to load into Web Map! \(error.localizedDescription)") } } Any help would be greatly appreciated!
... View more
09-03-2016
12:44 AM
|
0
|
4
|
1745
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:25 AM
|