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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:21:07+00:00 2026-06-13T09:21:07+00:00

I have an Android application and I’m trying to populate a Google Map with

  • 0

I have an Android application and I’m trying to populate a Google Map with a route, this route is store on a JSON array this way:

JSONArray.getString("points") = ["-33.45591917507404, -70.59198361376951","-33.453484420618416, -70.61635952929686"]

So in this case I have

Point A=(-33.49088437162095, -70.64043194102163) and

Point B=(-33.49423964397045, -70.63992768572683)

And my route or path is A—–B

I’m new to Android and I was wondering how to get this to work. Also, in this case my route is A—–B, but it can also be A—-B—-C—-D. I can have any number of points on the path.

  • 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-13T09:21:08+00:00Added an answer on June 13, 2026 at 9:21 am

    One thing you can try is the Google Maps Polyline object: https://developers.google.com/maps/documentation/javascript/reference#Polyline You specify to setPath() an ordered list of the points (either an Array of LatLng or an MVCArray or LatLng), you want to connect together on the map, and Google Maps will make a polyline for you to your specifications.

    // path = Array of LatLng or MVCArray of LatLng
    routeLine = new Polyline();
    routeLine.setPath(JSONArray);
    

    In your case, passing JSONArray into setPath should work OK.

    If you want to get fancy and incorporate directions, you need to use the Google Directions API. https://developers.google.com/maps/documentation/javascript/directions

    // All waypoints must be stopovers for the Directions service to optimize their route.
    // start & end are of type String or LatLng, waypts is an array of String or LatLng
    request = {
        origin: start,
        destination: end,
        waypoints: waypts,
        optimizeWaypoints: [type Boolean],
        travelMode: [type TravelMode]
    };
    // go on and actually perform the request
    directionsService.route(request, function(result, status) {
        if (status == google.maps.DirectionsStatus.OK) {
            // if successful, this will run
        }
    });
    

    Once you finish constructing your object, you should be able to display it by running setMap(map:Map), such as

    routeLine.setMap(map)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my android application i have used the google map. I have using android
I have an Android application, backed by an API. To this API users can
I have android application that is written regular way. layouts, java, APK. Now, depending
I have this android application which uses java-javascript bridge to pick up information from
I have an Android application with this lines in the manifest: <uses-sdk android:minSdkVersion=8 android:targetSdkVersion=13/>
i have this android application that requires to load data from a remote server
I have an android application uses Alertdialog.I am setting animation for this dialog.I want
i have an Android application in which i use a class to store static
I have an android application and am trying to test the installation by downloading
I have created android application that uses Google Maps, ans it works fine here

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.