如何获取谷歌地图的myLocationEnabled'蓝点总是在顶部

时间:2015-04-18 21:08:26

标签: ios google-maps swift uiimageview

这是GMSMapView内部的UIImageView示例。我的问题是Google的蓝点显示在UIImageView后面......我怎样才能让myLocationEnabled的蓝点始终显示在顶部?

@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

所有这些红色圆圈都是One UIImageView,它位于MapView内部。我希望当前位置位于此UIImageView的顶部...但是使用mapView.myLocationEnabled = true只是布尔属性而不是视图或标记......或者其他任何东西......我正在尝试做什么可能?任何帮助都会很棒......谢谢。

UIImageView inside of GMSMapView

0 个答案:

没有答案