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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:17:46+00:00 2026-06-09T18:17:46+00:00

I need to show below two points (A and B) on a radar circle

  • 0

I need to show below two points (A and B) on a radar circle image that I have created using Canvas in Android. And those two points have latitude and longitude values. Suppose Point A has these values-

Latitude: 37.33774833333334
Longitude: -121.88670166666667

Point B has these values-

Latitude: 37.336453
Longitude: -121.884985

I need to show these two above points on a Canvas by doing some sort of calculations from the center point of a circle as shown in the below image. Below is the code that is creating radar circle in Android like below-

public class CircleCanvas extends View{

    Context context;
    int[] imageNames=new int[6];

    public CircleCanvas(Context mContext,int mUser,int mfirstDis,int msecondDis,int mthirdDis,int mfourDis,int bgMap) {
        super(mContext);
        context = mContext;
        imageNames[0]=mUser;
        imageNames[1]=mfirstDis;
        imageNames[2]=msecondDis;
        imageNames[3]=mthirdDis;
        imageNames[4]=mfourDis;
        imageNames[5]=bgMap;
    }
    protected void onDraw(Canvas canvas) { 
        super.onDraw(canvas); 
        Paint p = new Paint(); 
        p.setColor(Color.BLACK); //BLACK 
        p.setStyle(Style.STROKE);
        //canvas.drawColor(Color.BLACK); //WHITE

        WindowManager mWinMgr = (WindowManager)context.getSystemService(Context.WINDOW_SERVICE);
        @SuppressWarnings("deprecation")
        int displayWidth = mWinMgr.getDefaultDisplay().getWidth();
        @SuppressWarnings("deprecation")
        int displayHeight = mWinMgr.getDefaultDisplay().getHeight();

        canvas.drawBitmap(BitmapFactory.decodeResource(getResources(),imageNames[5]), 0, 0, null);

        int totalCircle=4;
        int radius=40;
        int centerimagesize=13;

        for (int i = 1; i <= totalCircle; i ++) { 
            canvas.drawCircle(displayWidth/2,displayHeight/4, i*radius, p); 
            canvas.drawBitmap(BitmapFactory.decodeResource(getResources(),imageNames[i]), ((displayWidth/2)+(i*radius)),(displayHeight/4), null);
        } 

        canvas.drawLine((displayWidth/2-(totalCircle*radius)), (displayHeight/4), (displayWidth/2+(totalCircle*radius)), (displayHeight/4), p);
        canvas.drawLine((displayWidth/2), (displayHeight/4-(totalCircle*radius)), (displayWidth/2), (displayHeight/totalCircle+(4*radius)), p);
        canvas.drawBitmap(BitmapFactory.decodeResource(getResources(),imageNames[0]), ((displayWidth/2)-(centerimagesize/2)),((displayHeight/4)-(centerimagesize/2)), null);

        invalidate(); 
    } 


}

And this is the image of the Canvas from the above code-
enter image description here

And I am passing all the images that I am showing currently on the Canvas from the onCreate method

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    FrameLayout main = (FrameLayout) findViewById(R.id.main_view);
    CircleCanvas circleCanvas=new CircleCanvas(this,R.drawable.current_user,R.drawable.tenm,R.drawable.twentym,R.drawable.thirtym,R.drawable.fourtym,R.drawable.bg_map);
    main.addView(circleCanvas);

   locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
   locationManager.requestLocationUpdates(
            LocationManager.GPS_PROVIDER,
            MINIMUM_TIME_BETWEEN_UPDATES,
            MINIMUM_DISTANCE_CHANGE_FOR_UPDATES,
            new MyLocationListener()
    ); 
}

And I am not sure, how can I show two points(A and B) on that radar circle image by doing calculations from the center point of the circle that I have created using Canvas. Is there some angle calculation that needs to be done? I have seperate images for two points A and B in my drawable folder in Android project

  • 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-09T18:17:48+00:00Added an answer on June 9, 2026 at 6:17 pm

    The easiest way to do this is to use OverlayItem and GeoPoint in a MapView. https://developers.google.com/maps/documentation/android/hello-mapview. You may be better make the radar an OverlayItem as well.

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

Sidebar

Related Questions

I have two graphs with in one image, each with 5 points. Their value
Say I have two tables as outlined below: mysql> show columns from ping; +------------+------------------+------+-----+---------+----------------+
I have two input fields that need to hide when first visit. There will
I need to show a div positioned relative to where the link is that
I need to show a form using a button, and hide it when the
Last two nights I am struggle with below code. The problem is I need
I have configured two persistent units with the entity managers set up as show
In the code below, I have a dictionary of NSNumbers that are turned into
I have a text box in wxpython (see below) that stores the name of
I have a form that has two parts to it. Yes or No. Yes

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.