iphone - 根据用户在 map 中跟随的方向旋转图像
<p><p>我想按照用户跟随的方向旋转自行车/汽车图像。现在图像跟随方向但看起来没有方向性,我们可以说点不跟随方向:</p>
<pre><code>- (MKAnnotationView *)mapView:(MKMapView *)map viewForAnnotation:(id <MKAnnotation>)annotation
{
static NSString *AnnotationViewID = @"annotationViewID";
MKAnnotationView *annotationView = (MKAnnotationView *);
if (annotationView == nil)
{
annotationView = [[ initWithAnnotation:annotation reuseIdentifier:AnnotationViewID] autorelease];
}
annotationView.image = ;
annotationView.annotation = annotation;
return annotationView;
}
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
{
if (newLocation.horizontalAccuracy < 0)
return;
if(!newLocation)
return;
currentLocation = newLocation;
if(currentLocation != nil)
{
if (myAnnotation)
{
;
}
CLLocationCoordinate2D location = CLLocationCoordinate2DMake(currentLocation.coordinate.latitude, currentLocation.coordinate.longitude);
myAnnotation = [ initWithCoordinates:location title:@"Current Location" subTitle:nil];
;
}
}
</code></pre></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>查看核心位置的 <code>-</code>。 </p></p>
<p style="font-size: 20px;">关于iphone - 根据用户在 map 中跟随的方向旋转图像,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/18614680/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/18614680/
</a>
</p>
页:
[1]