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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T13:06:22+00:00 2026-05-24T13:06:22+00:00

Can anyone show me the simple method to draw a line between coordinates in

  • 0

Can anyone show me the simple method to draw a line between coordinates in the Google map?

I found some results in Google, but I am looking for something which is simple.

  • 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-24T13:06:26+00:00Added an answer on May 24, 2026 at 1:06 pm

    use this simple code…may be work in your application

    public class GPSLine extends MapActivity {
    
        private List<Overlay> mapOverlays;
        private Projection projection;
        MapView mapView;
    
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.main);
    
            mapView = (MapView) findViewById(R.id.mapview);
            mapView.setBuiltInZoomControls(true);
            mapView.setClickable(true);
    
            mapOverlays = mapView.getOverlays();
            projection = mapView.getProjection();
            mapOverlays.add(new MyOverlay(null));
    
        }
    
        @Override
        protected boolean isRouteDisplayed() {
            return false;
        }
    
    
        class MyOverlay extends ItemizedOverlay {
    
            private ArrayList<OverlayItem> mOverlays = new ArrayList<OverlayItem>();
            public MyOverlay(Drawable defaultMarker) {
                super(defaultMarker);
                // TODO Auto-generated constructor stub
            }
            @Override
            public void draw(Canvas canvas, MapView mapv, boolean shadow){
                super.draw(canvas, mapv, shadow);
    
                Paint mPaint = new Paint();
                mPaint.setDither(true);
                mPaint.setColor(Color.RED);
                mPaint.setStyle(Paint.Style.FILL_AND_STROKE);
                mPaint.setStrokeJoin(Paint.Join.ROUND);
                mPaint.setStrokeCap(Paint.Cap.ROUND);
                mPaint.setStrokeWidth(2);
    
                GeoPoint gP1 = new GeoPoint(19240000,-99120000);
                GeoPoint gP2 = new GeoPoint(37423157, -122085008);
    
                Point p1 = new Point();
                Point p2 = new Point();
    
            Path path = new Path();
    
                projection.toPixels(gP1, p1);
                projection.toPixels(gP2, p2);
    
                path.moveTo(p2.x, p2.y);
                path.lineTo(p1.x,p1.y);
    
                canvas.drawPath(path, mPaint);
            }
            @Override
            protected OverlayItem createItem(int i) {
                // TODO Auto-generated method stub
                return mOverlays.get(i);
            }
            @Override
            public int size() {
                // TODO Auto-generated method stub
                return 0;
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can anyone show a short and simple code snippet? It should take the name
Can anyone recommend some good resources that highlight the differences between Oracle and the
can anyone show me the syntax for inserting a python tuple/list into a mysql
Can anyone show me a way of converting SQL Server data-types (varchar for example)
I'd like to do this in the INSERT SQL. Can anyone show me. Thanks
Can anyone give me an idea how can we show or embed a YouTube
can anyone recommend a website crawler that can show me all of the links
Sorry if this question may be simple, but I can't seem to find an
Can anyone (maybe an XSL-fan?) help me find any advantages with handling presentation of
Can anyone tell me how I can display a status message like 12 seconds

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.