How to get Google Map's 'myLocationEnabled

2019-04-29 19:12发布

This is an example of a UIImageView inside of a GMSMapView. My problem is that Google's blue dot is showing behind the UIImageView...How can I get this blue dot for myLocationEnabled to always show on top?

@IBOutlet weak var mapView: GMSMapView!

func locationManager(manager: CLLocationManager!, didChangeAuthorizationStatus status: CLAuthorizationStatus){

    NSLog("Did Change Authorization Status")
    if status == CLAuthorizationStatus.AuthorizedWhenInUse {

        //This uses the location manager
        if locationManager.location != nil {
            currentLatitude = locationManager.location.coordinate.latitude
            currentLongitude = locationManager.location.coordinate.longitude
        }
        //How do I get this over my UIImageView?
        mapView.myLocationEnabled = true

        var TARGET: CLLocationCoordinate2D = CLLocationCoordinate2D(latitude: currentLatitude, longitude: currentLongitude)
        var camera: GMSCameraPosition = GMSCameraPosition(target: TARGET, zoom: 12, bearing: 0, viewingAngle: 0)
        mapView.camera = camera        
    }
}

enter image description here

All of these red circles are One UIImageView, that is inside of the MapView. I want the Current Location to be on top of this UIImageView...but using mapView.myLocationEnabled = true is only boolean property and is not a view or a marker...or anything really.. Is what I'm trying to do possible? Any help would be awesome...thanks.

UIImageView inside of GMSMapView

0条回答
登录 后发表回答