Discussion Forums  >  Maps, Device Location, Tracking

Replies: 8    Views: 112

Antonios
Apple Fan
Profile
Posts: 381
Reg: Feb 12, 2013
Korinthos, Gree...
4,610
05/04/13 03:26 AM (11 years ago)

Direct driving directions

Using the location map plugin when the user chooses the map direction, it opens maps and then you have to act like in every other situation when you want to navigate somewhere. Select the route option, start, end location.... etc. I wonder if there is an option through this plugin, so when the user selects the driving direction option, when the maps open show him directly the route without the user to so anything else
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
05/04/13 08:02 AM (11 years ago)
The capabilities of the plugin are documented in the 'read me' file.
 
Antonios
Apple Fan
Profile
Posts: 381
Reg: Feb 12, 2013
Korinthos, Gree...
4,610
like
05/04/13 09:50 AM (11 years ago)
Yes ok, I'm using it and it works just fine...I just wonder if there is that option too...
 
Antonios
Apple Fan
Profile
Posts: 381
Reg: Feb 12, 2013
Korinthos, Gree...
4,610
like
05/07/13 08:45 AM (11 years ago)
I found out myself....At "BT_screen_map.m": Go to around line 756 at: /* Maps URL Params and replace the whole thing until: ////////////////////////////////////////////////////////////////////////////////////////////////// //downloader delegate methods with these lines: /* Maps URL Params -------------------- saddr =starting address daddr =destination address z =zoom level (1 - 20) t =the map type, "m" map, "k" satellite, "h" hybrid, "p" terrain */ if([fromLat length] > 3 && [fromLon length] > 3 && [toLat length] > 3 && [toLon length] > 3){ NSString *urlString = [NSString stringWithFormat:@"http://maps.apple.com?saddr=%@,%@&daddr=%@,%@", fromLat, fromLon, toLat, toLon]; [[UIApplication sharedApplication] openURL: [NSURL URLWithString: urlString]]; }else{ UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:nil message:NSLocalizedString(@"locationNotSupported", "It appears that device location information is unavailable. This feature will not work without location information.") delegate:self cancelButtonTitle:NSLocalizedString(@"ok", "OK") otherButtonTitles:nil]; [alertView show]; [alertView release]; } }else{ //do nothing, alert closes automatically } }
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
05/08/13 12:26 AM (11 years ago)
Very nice indeed! You could probably substitute Google Maps as well (providing you added the SDK) if you modify the urlString slightly. Nice Job! Cheers! -- Smug
 
Antonios
Apple Fan
Profile
Posts: 381
Reg: Feb 12, 2013
Korinthos, Gree...
4,610
like
05/08/13 01:55 AM (11 years ago)
mmmm...didn't think of that...I can add the sdk and load the google maps instead of apple's? As I haven't done anything like this before...can you plz guide me here a little? thanks...
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
05/08/13 02:26 AM (11 years ago)
All of the instructions are laid out here: https://developers.google.com/maps/documentation/ios/start With respect to step 6, most of the SDK's are already in a basic Buzztouch project. You just need to add: GLKit.framework ImageIO.framework libc++.dylib libicucore.dylib libz.dylib They require an API key as well now, even for iOS. You get that in your developer console; there are links in the above document. When you do get your API Key, it seems to me that you 'can not' put the API key in your plugin code... It 'HAS' to go in your appDelegate.m file. I put mine at the bottom of the 'didFinishLaunchingWithOptions' area, and that seemed to work. It 'might' work where the Scringo API key goes, but I did all this pre-scringo, so I haven't tried it there. this goes in the appDelegate --> [GMSServices provideAPIKey:@"YOUR_API_KEY"]; The sample code is basic, but it will get you going. For more advanced stuff, I haven't found too much documentation, but there seems to be more than a few YouTube videos on the subject. search with 'google maps iOS 6' and they should pop up. Hope this helps! Cheers! -- Smug
 
Antonios
Apple Fan
Profile
Posts: 381
Reg: Feb 12, 2013
Korinthos, Gree...
4,610
like
05/08/13 02:51 AM (11 years ago)
thank you smug...your help is much appreciated...I'll try these steps and hope everything will work just fine...
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
05/08/13 04:19 AM (11 years ago)
Happy to help. I didn't take it too much further, because I've decided to go 'offline' with my mapping, thus am working with the 'route-me' SDK, which allows for the use of offline maps in a SQLite database. Rather nifty stuff, but some things take a while to figure out. Hopefully before too long, I might be able to hammer out some kind of basic 'how to' on using it, but although it's not too hard to implement, the gathering of your maps to use offline takes a bit of work. If you want to look at it, We discussed it a bit in this post, which has some good links: https://www.buzztouch.com/forum/thread.php?tid=858406F4E3FE7738C539F02 Whichever direction you decide to go (pun intended) I wish you the best! Cheers! -- Smug
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.