mapView.delegate = self与当前位置

时间:2016-01-07 20:01:47

标签: ios swift mapkit

我正在将我的mapView委托设置为self以使我的引脚标注工作,当我这样做时,我的当前位置也显示为引脚。我该如何解决这个问题?enter image description here

    mapView.delegate = self


    self.locationManager.delegate = self


    self.locationManager.desiredAccuracy = kCLLocationAccuracyBest


    self.locationManager.requestWhenInUseAuthorization()


    self.locationManager.startUpdatingLocation()


    self.mapView.showsUserLocation = true

2 个答案:

答案 0 :(得分:2)

func mapView(mapView: MKMapView, viewForAnnotation annotation: MKAnnotation) -> MKAnnotationView? {     
    if annotation.isKindOfClass(MKUserLocation) {
        return nil
    }
}

答案 1 :(得分:1)

<connectionStrings>
    <add name="liderdatabaseEntities" 
         connectionString="metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=(LocalDB)\v11.0;attachdbfilename=C:\Users\Bertan\Documents\liderdatabase.mdf;integrated security=True;connect timeout=30;MultipleActiveResultSets=True;App=EntityFramework&quot;" 
         providerName="System.Data.EntityClient" />
</connectionStrings>