我正在开发应用程序,用户通过gps进行本地化,然后询问他是否位于特定位置.为了证实这一点,他会立即向他提出标注泡沫,询问他是否在特定的地方.
由于有很多类似的问题,我能够做自定义标注泡泡:

我的问题:按钮不是"可点击"我的猜测:因为这个自定义标注高于标准标注泡泡,我不得不将它放在负"框架"中,因此无法点击按钮.这是我的didSelectAnnotationView方法
- (void)mapView:(MKMapView *)mapView didSelectAnnotationView:(MKAnnotationView *)view {
if(![view.annotation isKindOfClass:[MKUserLocation class]]) {
CalloutView *calloutView = (CalloutView *)[[[NSBundle mainBundle] loadNibNamed:@"callOutView" owner:self options:nil] objectAtIndex:0];
CGRect calloutViewFrame = calloutView.frame;
calloutViewFrame.origin = CGPointMake(-calloutViewFrame.size.width/2 + 15, -calloutViewFrame.size.height);
calloutView.frame = calloutViewFrame;
[calloutView.calloutLabel setText:[(MyLocation*)[view annotation] title]];
[calloutView.btnYes addTarget:self
action:@selector(checkin)
forControlEvents:UIControlEventTouchUpInside];
calloutView.userInteractionEnabled = YES;
view.userInteractionEnabled = YES;
[view addSubview:calloutView];
}
}
Run Code Online (Sandbox Code Playgroud)
CalloutView只是简单的类,有2个属性(标签显示地方名称和按钮)和xib.
我一直在做这个自定义标注泡泡几天.我尝试使用"异步解决方案" 解决方案,但我无法添加任何其他类型的按钮然后披露按钮.
我的下一次尝试是找到比异步解决方案更容易的东西并将其修改为我的用途.多数民众赞成我如何找到tochi的自定义标注.

基于他的工作,我能够自定义他的泡泡并更改我的自定义按钮的信息按钮.然而,我的问题仍然存在.为了将我的自定义标注视图放在引脚顶部,我不得不给它负帧,所以我的按钮只能在底部5个像素中"可点击".看来,我必须深入挖掘ios默认的标注气泡,将其子类化并在那里更改标注框架.但我现在真的很无望.
如果你们能告诉我正确的方法,或者给我建议,我会很高兴的.
我正在UITapGestureRecognizer委托中创建一个带有标注的简单点注释.
我第一次点击地图时,引脚会出现带有标注,但标注会立即消失.
第二次点击相同的引脚时,标注出现并停留在那里,不知道为什么它会在第一次消失.
@IBAction func handleMapTouch(recognizer: UITapGestureRecognizer){
let view = recognizer.view
let touchPoint=recognizer.locationInView(view)
var touchCord=CLLocationCoordinate2D()
touchCord = mapView.convertPoint(touchPoint, toCoordinateFromView:
mapView)
mapView.removeAnnotations(mapView.annotations)
pointAnnotation.coordinate=touchCord
pointAnnotation.title="ABC"
pointAnnotation.subtitle="DEF"
mapView.addAnnotation(pointAnnotation)
mapView.selectAnnotation(pointAnnotation, animated: true)
}
Run Code Online (Sandbox Code Playgroud) 我想知道是否有可能使用Javascript在iOS和Android上触发"保存图像"触摸标注.标注是由长按触发的,但即使我尝试模拟它,它也不起作用.
我想实现这样的事情:
jQuery('img').openCallout();
Run Code Online (Sandbox Code Playgroud)
到目前为止我试过这个:
jQuery: jQuery('img').contextmenu();
jQuery Mobile: jQuery('img').taphold();
目前我正在使用ios mkmapview来显示在地图上添加pin的poi,当用户点击pin时,默认的callout会出现并显示poi的标题,但是有些标题很长而且标注不够宽,无法完全显示标题.我想要的只是让标注更宽,我该怎么做?我搜索了几个小时的答案,但都是关于为callout实现自定义类,有没有办法只是重新调整大小而不进一步实现?我想念一些明显的东西吗?
我有一个带有自定义注释的iOS应用程序.
我知道didSelectAnnotationView只应该用于初始选择注释.([1]:选择一个MapView注释两次 ),并基于这篇文章和其他人我已经读过([2]:通过点击地图关闭注释标注的ios mapkit),它看起来像是在检测到MKAnnotationView之后的任何额外点击它被选中需要一个UITapGestureRecognizer.
所以,我正在使用UITapGestureRecognizer,当我已经选择了我的注释视图时,我正在检测其他点击,当我识别出点击时我正在调用deselectAnnotation,而我正在隐藏/取消选择标注/注释分别.它在iOS5中运行良好,但它只有一半适用于iOS6
在iOS6中,调用轻击手势识别器,我调用我的代码来隐藏标注并取消选择注释,一切都很好,但随后以某种方式调用selectAnnotationView方法,因此我的标注再次显示,我的注释再次被选中.
我假设发生的事情是,在我的点击手势识别器中取消选择注释视图后,点击事件仍处于活动状态,mapView检测到触摸事件并调用selectAnnotationView,因此注释我只是现在正在再次选择取消选择.
我不知道为什么它只发生在iOS6中,但我希望能够输入任何其他想法来处理我想要的行为.
在我的地图注释中,我有一个UIButton作为标注中的每个附件视图.在该- (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control方法中,如何确定触摸哪个附件视图来处理每个事件?这是我的代码:
-(MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id<MKAnnotation>)annotation {
if ([annotation isKindOfClass:[MKUserLocation class]])
return nil;
MKPinAnnotationView *MyPin=[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"current"];
UIButton *calloutButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
UIButton *directionsButton = [UIButton buttonWithType:UIButtonTypeCustom];
directionsButton.frame = CGRectMake(0, 0, 23, 23);
[directionsButton setBackgroundImage:[UIImage imageNamed:@"directions.png"] forState:UIControlStateNormal];
MyPin.leftCalloutAccessoryView = directionsButton;
MyPin.rightCalloutAccessoryView = calloutButton;
MyPin.draggable = NO;
MyPin.highlighted = NO;
MyPin.animatesDrop= YES;
MyPin.canShowCallout = YES;
MyPin.pinColor = MKPinAnnotationColorRed;
return MyPin;
}
- (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control {
Annotation *ann = view.annotation; …Run Code Online (Sandbox Code Playgroud) 我有一个calloutDetail的观点:
annotationView.detailCalloutAccessoryView = mapInformationView.view
它工作正常,但我不想显示标题/副标题,只是我的自定义视图.但是当我将标题/副标题留空时,不会显示标注.
那么,我如何隐藏它们或只是改变它们的字体大小和名称?
我已经实现了与Uber iOS应用程序相同的功能,可以根据带动画的路径移动引脚.
问题:当我在移动时点击它时,我无法获得该didSelectAnnotationView代表MKMapView.但是当引脚稳定意味着不移动时,它会被调用.
代码:创建引脚
-(MKAnnotationView*)mapView:(MKMapView*)mapView viewForAnnotation:(id<MKAnnotation>)annotation {
if([annotation isKindOfClass:[MKUserLocation class]])
return nil;
else {
NSString *annotationIdentifier = @"CustomViewAnnotation";
AnnotationView * annotationView = (AnnotationView *)[mapView dequeueReusableAnnotationViewWithIdentifier:annotationIdentifier];
if(annotationView == nil) {
annotationView = [[AnnotationView alloc] initWithAnnotation:annotation
reuseIdentifier:annotationIdentifier];
UIImage *pinIcon = [UIImage imageNamed:@"carIcon"];
annotationView.btnInfo = [[UIButton alloc] init];
annotationView.frame = CGRectMake(0.0f, 0.0f, pinIcon.size.width, pinIcon.size.height);
annotationView.btnInfo.frame = annotationView.frame;
[annotationView.btnInfo setBackgroundImage:pinIcon forState:UIControlStateNormal];
[annotationView addSubview:annotationView.btnInfo];
[annotationView.btnInfo setUserInteractionEnabled:NO];
}
else
annotationView.annotation = annotation;
annotationView.enabled = YES;
annotationView.canShowCallout = YES;
return …Run Code Online (Sandbox Code Playgroud) 我想在我的 R 图中添加标注文本。例如,我有一些情节:
x <- seq(0, 2, by=0.1)
y <- x*x
plot(x, y, type="l")
Run Code Online (Sandbox Code Playgroud)

我想添加一些这样的标注文本:

有一些标准的方法吗?
我已经实现了 Blend 的 Callout 控件。我面临的问题是标注的锚点从顶部开始有一些边距,而我想从标注的左上角开始锚点。任何帮助将不胜感激。
我现在拥有的:
我想要什么:

callout ×10
ios ×7
mapkit ×3
mkmapview ×3
annotations ×2
objective-c ×2
swift ×2
android ×1
frame ×1
graphics ×1
javascript ×1
map ×1
mkannotation ×1
plot ×1
r ×1
text ×1
title ×1
uibutton ×1
web ×1
wpf ×1