我想创建一个自定义的MKAnnotationView标注,如图所示.我已经测试了几种解决方案,但它们只允许自定义左/右图像和标题/副标题.有人可以给我一些源代码或教程链接吗?
目前我很无能为力.请帮忙.

我想在MKMapView上创建一个自定义标注气泡.但我想以与默认气泡相同的方式创建呼出气泡.那么如何在此图像中创建一个类似于注释的视图 替代文本http://blog.objectgraph.com/wp-content/uploads/2009/04/mapkit31.png
我想要一个自定义自定义视图,在下图中看起来像"停放位置"注释.具有自定义宽度,高度等
我无法在默认气泡中添加所需的详细信息.这就是为什么要创建自定义泡泡.
Plz帮帮我..谢谢..
我有一个可以快速更新的注释数据集.目前我删除所有注释,然后将它们重新绘制回地图上.
NSArray *existingpoints = [mapView.annotations filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"!(self isKindOfClass: %@)", [MKUserLocation class]]];
[mapView removeAnnotations:existingpoints];
Run Code Online (Sandbox Code Playgroud)
我在自定义对象中计算它们的位置,因此希望能够调用它并"移动"注释而不删除并将其重新添加回地图.我制作的示例调用工作,我想几乎"民意调查"在下面.
- (CLLocationCoordinate2D) coordinate
{
CLLocationCoordinate2D coord;
coord.latitude = [lat doubleValue];
coord.longitude = [lon doubleValue];
double differencetime = exampleTime;
double speedmoving;
double distanceTravelled = speedmoving * differencetime;
CLLocationDistance movedDistance = distanceTravelled;
double radiansHeaded = DEG2RAD([self.heading doubleValue]);
CLLocation *newLocation = [passedLocation newLoc:movedDistance along:radiansHeaded];
coord = newLocation.coordinate;
return coord;
}
Run Code Online (Sandbox Code Playgroud)
根据要求,Object的.h文件,我没有SetCoordinate方法..
#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>
#import <MapKit/MapKit.h>
@interface TestObject : NSObject <MKAnnotation>{
NSString *adshex;
NSString *lat;
NSString *lon;
NSString …Run Code Online (Sandbox Code Playgroud) 我是objective-c中的mapkit新手.我可以在mapview中添加自定义注释.
我需要放置自定义标注视图,如下图所示
.
但我没有得到如何设计这样的标注视图.
我知道我需要在视图中为注释方法添加callout.
- (MKAnnotationView *)mapView:(MKMapView *)map viewForAnnotation:(id <MKAnnotation>)annotation
{
static NSString *AnnotationViewID = @"annotationViewID";
MKAnnotationView *annotationView = (MKAnnotationView *)[mapview dequeueReusableAnnotationViewWithIdentifier:AnnotationViewID];
if (annotationView == nil)
{
annotationView = [[[MKAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:AnnotationViewID] autorelease];
}
annotationView.image = [UIImage imageNamed:@"blue_without_pin.png"];
annotationView.annotation = annotation;
return annotationView;
}
Run Code Online (Sandbox Code Playgroud) 我喜欢实施...... 像这样.我有两个带标注的注释,但MKMapView只允许同时选择一个.
[mapView selectAnnotation:self.firstAnnotation animated:FALSE];
[mapView selectAnnotation:self.secondAnnotation animated:FALSE];
Run Code Online (Sandbox Code Playgroud)
当我选择另一个注释时,第一个注释会自动取消选择.
但在下图中,它已成功实施.那么怎么做呢? http://oi52.tinypic.com/14t3t09.jpg
我正在使用这里解释的代码(Jacob的一个)实现一个自定义的MKAnnotationView标注,它实际上放置了另一个Custom AnnotationView,因为选择了Annotation:
MKAnnotationView - 锁定自定义注释视图以固定位置更新
一切都很好,但我有一些奇怪的行为.点击自定义标注后,它将关闭标注,但之后会停止调用regionDidChangeAnimated委托方法.
我错过了什么?我可以照常平移地图,但它不会调用该委托方法.虽然如果放大或缩小它会被调用.
在为我正在放置的AnnotationView添加自定义CallOut之前,这种情况从未发生过.
Thx提前.
此致,艾伦//