MapKit iPhone 开发 - 向地图添加注释 - iOS SDK
我想在地图上创建注释,如下所示:
如果单击蓝色箭头,则会打开一个菜单。 菜单中应该有两个菜单点。 第一个是电话号码(如果我点击 iPhone 拨打/拨打这个号码的号码),第二个是“到这里的路线”。
目前我运行此代码
MKCoordinateRegion region4 = { {0.0, 0.0 }, { 0.0, 0.0 } };
region4.center.latitude = 48.13479 ;
region4.center.longitude = 11.582111;
region4.span.longitudeDelta = 0.01f;
region4.span.latitudeDelta = 0.01f;
DisplayMap *ann4 = [[DisplayMap alloc] init];
ann4.title = @"The Title!";
ann4.subtitle = @"The Subtitle!";
ann4.coordinate = region4.center;
[mapView addAnnotation:ann4];
如何显示如图所示的蓝色箭头?你能建议我这个吗..
I would like to create annotations on a Map like this:
If you click on the blue arrow a menu should open.
In the menu should be two menu points.
First a Telephone number (if I click on the number the iphone dial/call this number) and second a "Directions to here".
At the moment I run on this code
MKCoordinateRegion region4 = { {0.0, 0.0 }, { 0.0, 0.0 } };
region4.center.latitude = 48.13479 ;
region4.center.longitude = 11.582111;
region4.span.longitudeDelta = 0.01f;
region4.span.latitudeDelta = 0.01f;
DisplayMap *ann4 = [[DisplayMap alloc] init];
ann4.title = @"The Title!";
ann4.subtitle = @"The Subtitle!";
ann4.coordinate = region4.center;
[mapView addAnnotation:ann4];
How do I show blue-arrow as shown in the image? Can you please suggest me on this..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您必须在
MKAnnotationView
的rightCalloutAccessoryView
中添加UIButtonTypeDetailDisclosure
类型的UIButton
。You have to add a
UIButton
of typeUIButtonTypeDetailDisclosure
in therightCalloutAccessoryView
of yourMKAnnotationView
.查看 MKAnnotationView 类参考 ,特别是“管理标注视图”。
Check out the MKAnnotationView Class Reference, and "Managing Callout Views" specifically.