简体   繁体   English

使用route-me RMMapView将图钉添加到离线地图

[英]Adding pins to offline map using route-me RMMapView

I am using the route-me files found at https://github.com/route-me/route-me to build a offline map application for iPhones. 我正在使用https://github.com/route-me/route-me上的route-me文件来构建iPhone的离线地图应用程序。 I have the map working offline and also successfully implemented "current location" button that will show the users location on the map with a marker. 我使地图脱机工作,并且还成功实现了“当前位置”按钮,该按钮将使用标记在地图上显示用户的位置。

Now, I want to be able to let the users be able to drop "pins" on the map so that users can get the coordinates of the "pins" that user just dropped on the map. 现在,我希望能够让用户能够在地图上放置“大头针”,以便用户可以获取用户刚刚在地图上放置的“大头针”的坐标。 (separate from the current location) (与当前位置分开)

I have tried to look for tutorials and other helpful documents on Google but all the information that I've found are using the MapKit lib and framework If any of you are expert on route-me and using RMMapView to make offline maps, it would be awesome if you guys can help me out. 我试图在Google上寻找教程和其他有用的文档,但是我发现的所有信息都在使用MapKit库和框架。如果你们中的任何人都擅长route-me并使用RMMapView制作离线地图,那将是如果你们能帮助我,那就太好了。

Thanks 谢谢

For droping pins on RMMapview , this is required snippet of code used in - (void)viewDidLoad after creating RMMapview 要在RMMapview上放置图钉,这是创建RMMapview后在-(void)viewDidLoad中使用的必需代码段

RMMarkerManager *markerManager = [[[RMMarkerManager alloc] initWithContents: mapView]autorelease];
RMMarker *marker = [[RMMarker alloc]initWithUIImage:[UIImage imageNamed:@"marker-blue.png"] anchorPoint:CGPointMake(0.5, 1.0)];
[marker setTextForegroundColor:[UIColor blueColor]];
[markerManager addMarker:marker AtLatLong:(CLLocationCoordinate2D){40.988,23.098}];
[marker release];

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM