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 240567
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:40:39+00:00 2026-05-11T20:40:39+00:00

Programming an iPhone App, I need to use Google Maps api to get directions

  • 0

Programming an iPhone App, I need to use Google Maps api to get directions and routes. Unfortunatelly, Google Maps works around javascript.

Any idea how to do this?

  • 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-11T20:40:39+00:00Added an answer on May 11, 2026 at 8:40 pm

    You can implement this by using a UIWebView. When it comes to using JavaScript to access the Google Maps service through its Google Maps APIs, you simply take advantage of the UIWebView method:

    - (NSString *)stringByEvaluatingJavaScriptFromString:(NSString *)script
    

    Note that you will need to escape in the string representing your script, all of the occurrences of double quotes as needed.

    As an example, the following method, needed to center a map, is taken from chapter 12 of iPhone SDK programming, by Maher Ali:

    -(void) centerMap:(NSUInteger) index{
        CLLocation *loc = [locations objectAtIndex:index];
        NSString *js = 
        [NSString stringWithFormat:
         @"var map = new GMap2(document.getElementById(\"map_canvas\"));"
         "map.setMapType(G_HYBRID_MAP);"
         "map.setCenter(new GLatLng(%lf, %lf), 18);"
         "map.panTo(map.getCenter());"  
         "map.openInfoWindow(map.getCenter(),"
         "document.createTextNode(\"Loc: (%i/%i), Time: %@\"));", 
         [loc coordinate].latitude, [loc coordinate].longitude,
         index+1, [locations count], 
         [loc timestamp]];
        [webView stringByEvaluatingJavaScriptFromString:js];
    }
    

    Also, bear in mind the following from the Apple documentation:

    JavaScript execution time is limited to 10 seconds for each top-level entry point. If your script executes for more than 10 seconds, Safari stops executing the script. This is likely to occur at a random place in your code, so unintended consequences may result. This limit is imposed because JavaScript execution may cause the main thread to block, so when scripts are running, the user is not able to interact with the webpage.

    JavaScript allocations are also limited to 10 MB. Safari raises an exception if you exceed this limit on the total memory allocation for JavaScript.

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

Sidebar

Ask A Question

Stats

  • Questions 122k
  • Answers 122k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I think the xsd needs to be in the class… May 12, 2026 at 12:44 am
  • Editorial Team
    Editorial Team added an answer You could associate each PDF file with a guid in… May 12, 2026 at 12:44 am
  • Editorial Team
    Editorial Team added an answer Use a selector that will select all the rows and… May 12, 2026 at 12:44 am

Related Questions

I am programming an iPhone app, and I need to force it to exit
In an iPhone app I currently have code for downloading a file from the
I'm trying to work out the correct way to handle populating an array with
I'm learning iPhone programming from Erica Sadun's The iPhone Developer's Cookbook. When I run

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.