I am trying to use the Mapbox iOS8 Swift cocoa Mapbox plugin for mapbox and am encountering a problem while trying to show users location on mapView. My code is as follows
func mapView(mapView: MGLMapView!, symbolNameForAnnotation annotation: MGLAnnotation!) -> String! { return "secondary_marker" } let manager = CLLocationManager() override func viewDidLoad() { super.viewDidLoad() let mapView = MGLMapView(frame: view.bounds, accessToken: "pk.privateMapboxAccessTokenGoesHere") mapView.autoresizingMask = .FlexibleWidth | .FlexibleHeight if CLLocationManager.authorizationStatus() == .NotDetermined { manager.requestAlwaysAuthorization() } mapView.showsUserLocation = true let x:MGLUserLocation = mapView.userLocation println(mapView.userLocation) println(x.coordinate.latitude) println(x.coordinate.longitude) ... more code here to show map works. }
I made the necessary changes to info.pList and get the corresponding message when I first launch my application. The problem is this:
<MGLUserLocation: 0x7fd8aa6c9a00> 3.40282346638529e+38 3.40282346638529e+38
Can someone provide me an example of how I can show the location of users (blue dot) on the map.
source share