简体   繁体   中英

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. 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.

Thanks

For droping pins on RMMapview , this is required snippet of code used in - (void)viewDidLoad after creating RMMapview

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];

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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