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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T13:51:32+00:00 2026-06-16T13:51:32+00:00

I am using google api V3 in my iOS App, I requested to google

  • 0

I am using google api V3 in my iOS App,
I requested to google api direction service, by http GET method, I got a very large json response, I got many alternate routes from origin to destination, now I want to show the route of each alternative on map, how should I done this ? is there any need to integrate google sdk in iOS, or can i use webView only, please help me, and suggest the simplest way.
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-06-16T13:51:33+00:00Added an answer on June 16, 2026 at 1:51 pm

    you do not need to include any google SDK to draw the route over map. Look at the following classes.

    MKPolyline

    MKPolyLineview

    The google map api Direction service will give you the legs(coordinates) to draw the route between two specific points.

    As you already have the json response from the Direction api now you have to parse the json and get all the legs point from the json to create Coordinate array.

    Jsonkit for parsing

    These points may be or mostly encripted. How to decode the Google Directions API polylines field into lat long points in objective-C for iPhone?

    If you have the coordinates array then first you have to create a CLLocationCoordinate2D array like following:

    CLLocationCoordinate2D *pointArr        =       malloc(sizeof(CLLocationCoordinate2D) * [your_CoordinateArray count]);
    
    for(int i = 0; i < [your_CoordinateArray count]; i++){
      pointArr[i]       =      [your_CoordinateArray objectAtIndex:i];
    }
    

    Then you have to add the polyline to your map

     MKPolyline *line                        = [MKPolyline polylineWithCoordinates:pointArr count:[your_CoordinateArray count]];
    
        if (nil != line)
        {
            [your_Map addOverlay:line];
    
        }
    

    Then you have to implement the following map delegate:

    - (MKOverlayView *)mapView:(MKMapView *)mapView viewForOverlay:(id <MKOverlay>)overlay
    {       
    
    MKOverlayView* overlayView = nil;
    
    lineView                    =       [[MKPolylineView alloc] initWithPolyline:overlay];// lineView is an ivar, object of MKPolylineView
    lineView.fillColor          =       [UIColor greenColor];
    lineView.strokeColor        =       [UIColor greenColor];
    
    lineView.lineWidth          =       10.0;
    lineView.alpha              =       0.9;
    overlayView                 =       lineView;
    
    return overlayView;
    }    
    

    Now, if you want to show two different routes between two points then you have to create two different array of coordinates and apply the above method for both Arrays

    Hope this will help you.

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

Sidebar

Related Questions

I'm trying to get access to the Google Drive API using RestKit on iOS
I am using google api to get search result for certain queries in JSON
i am new in iOS I want to call google api direction service, and
Since Days i'm trying to parse a YOUTUBE-XML-Feed by using GDATA-API for iOS. http://code.google.com/intl/de-DE/apis/youtube/2.0/developers_guide_protocol_channel_search.html
In my app i was using google api to get weather details, but i
I'm using both a Google Places API and a Facebook iOS SDK API in
I am using google Api for custom search and have done the json Parsing.
I am trying to parse some data from json file while using google api
I am trying to include Google+ api and foursquare api in my ios app.
I am using the Google Geocoding API v3[1] from an iOS application but can't

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.