Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7404611
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:16:45+00:00 2026-05-29T05:16:45+00:00

I created an app that displays different points on a custom map with custom

  • 0

I created an app that displays different points on a custom map with custom pins and showing the title and subtitle with a disclosure button (all right). The problem arises when the app launches maps to create the path and then provide directions. To move from the position of the user I’ve simply typed in the URL “saddr=Current Position”. The problem comes when I try to give the destination that the user has touched, relative to the pin touched.

- (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control {

    [self.navigationController pushViewController:[[UIViewController alloc] init] animated:YES];
    NSString* addr = [NSString stringWithFormat:@"http://maps.google.com/maps?daddr=%1.6f%1.6f&saddr=Posizione Attuale", mapView.annotations.coordinate.latitude mapView.annotations.coordinate.longitude];

//also mapview.annotation.coordinate.latitude/longitude doesn’t work

        NSURL* url = [[NSURL alloc] initWithString:[addr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
    [[UIApplication sharedApplication] openURL:url];
}

I can not figure out how to pass the coordinates of the annotation in the piece of code!

Here’s how I said and added the annotation to my view

    NSMutableArray* annotations=[[NSMutableArray alloc] init];


    CLLocationCoordinate2D theCoordinate1;
    theCoordinate1.latitude = 45.7;
    theCoordinate1.longitude = 7.64;
myAnnotation* myAnnotation1=[[myAnnotation alloc] init];

    myAnnotation1.coordinate=theCoordinate1;
    myAnnotation1.title=@"Pippo";
    myAnnotation1.subtitle=@"Ufficio";
[myMapView addAnnotation:myAnnotation1];

This repeated for 4 main points that have different names (myAnnotation1, 2, 3, 4) and coordinates other! How can I do when the user touches 1-2-3 or 4 to move the right destination?

Thanks in advance! 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T05:16:46+00:00Added an answer on May 29, 2026 at 5:16 am

    In calloutAccessoryControlTapped, why are you pushing a blank view controller and calling openURL at the same time?

    Anyway, the annotation’s coordinates are in view.annotation.coordinate.

    So the latitude is view.annotation.coordinate.latitude and longitude is view.annotation.coordinate.longitude.

    Also, in your addr string, you are missing a comma between the coordinates.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create a simple app that displays a list of items
I wish to create a very simple web app that simply displays an Image(s)
I'm intending to create a flash app that pulls images from facebook and displays
I've created an app that interacts with a SOAP service using java WS. I
I have successfully created an app that reads from a bundled .plist file and
I have created an app that uses NSTimer, which gets triggered each second. My
I am new to Windows Mobile and created an app that needs to do
I've just created a little app that programmatically compiles code using the C# Compiler,
After some studying, I created a small app that calculates DFTs (Discrete Fourier Transformations)
I'm building a web app that displays a list of customers in a table.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.