ios - Multiple Google Maps Navigation -


I think I'm a total idiot here, but I have total brain fart and XCode . To be able to navigate to a certain destination for the user, I have to open this code (below) Google Maps on which they click the button. On this page it's a fixtures list, which has an option next to navigation matches, am I right in saying that I do not need a new view controller because Google Maps should also pop up on the button press?

In addition to this, I will need to create an IBOutlet at the top to create by pressing the button segue , obviously I will code this code to - (zero ) Will not be able to view the view in the because I only want to show the button on the basis of press

  - (zero) getDirections {CLLocationCoordinate2D start = {(startLatitude), (startLongitude)}; CLLocationCoordinate2D end = {(end latitude), (endlined)}; NSString * googleMapsURL String = [NSString stringWithFormat: @ "http://maps.google.com/?saddr=%1.6f,%1.6f&daddr=%1.6f,%1.6f", start.latitude, start.longitude , End.latitude, end.longitude]; [[UIApplication shared application] Opal: [NSL URL URL string: googleMapsURL String]]; }    

If I think right, you can give directions to different matches Need to open Google Maps for

First of all, you are right about whether or not you are a new view controller, because you are calling, you do not need to create a new view controller

 < Code> [[UIApplication shared application] Open URL: [NSURL URLWithString: googleMapsURLString]];   

And this should open GoogleMaps to display the instructions given by your origin & amp; The destination coordinates are fine, if there is no possible direction then GoogleMaps will still open and tell you that no instructions were found.

What you should do:

  1. Place an array with your matching destination coordinates.
  2. Be aware of your current coordinates (if you are trying to provide directions from your current situation to a match location).
  3. Create an IBAction for handling buttons

    - (IBAction) button pressed: (ID) Sender {// to open your code here};

  4. According to the sender you can find out what button was pressed. You have different ways to do this. A possible way is to add a tag to every button from the interface builder and later to read which tag was pressed to read the tag. Another option if you have a fixed amount button, for example 3 is to create IBOutlets for each button and compare the sender with 'IBolet'. Once you know that the sender will need to recover the coordinates associated with that button / match for the IBAction pressed button button.

  5. Remember to link your contacts within the event on your button with IBAction.
  6. If you choose to prepare an IBOLT for each button, remember to link buttons with its outlets.

    I hope it will be helpful!

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -