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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T12:24:52+00:00 2026-05-31T12:24:52+00:00

Is it possible to do this? Im no good at painting stuff out got

  • 0

Is it possible to do this? Im no good at painting stuff out got a very basic “Dot class” which draws a circle based on x and y but the cavas is in a FrameLayout the size of about half my emulated 3,7 in screen. Needless to say ive only got about 150 on the y and something like 200 on the x (guess its pixels). Is there a way to scale the canvas to paint coordinates?

Preferably my lociation gets drawn in the center and other locations in my viewing “range” gets painted based on my location.

So im basically asking if there is a way to scale a canvas to coordinates and allow me to specify that scale. so if Im at 32.345 and -212.988765 thats the center and I can see other locations within say a 10km range or something like that.

My current Dot class:

    public class Dot extends View{
    private final float x;
    private final float y;
    private final int r = 5;
    private final Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);

    public Dot(Context context, float x, float y) {
        super(context);
        mPaint.setColor(0xFFFF0000);
        this.x = x;
        this.y = y;
    }

    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);

        canvas.drawCircle(x, y, r, mPaint);
    }


}

The reporting of gps coordinates is working and painting is working but only if its within the range of the canvas right now.

Just to make it clear, everything in my app is working and the correct coordinates are being passed around, the last part I need is a visual representation and I have no idea on how to get the canvas to act like a map.

Edit Another problem im having is the drawing, when the position updates it sure does redraw but it appends a new circle leaving the old one still there. How do I refresh it completely so the circle “moves” instead of appending a new one? I tried calling invalidate on the view but that didnt do anything.

  • 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-31T12:24:53+00:00Added an answer on May 31, 2026 at 12:24 pm

    You need to come up with a formula for translating the GPS coordinates to the coordinates of your canvas. It looks like this question is close to what you need: Mercator longitude and latitude calculations to x and y on a cropped map (of the UK)

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

Sidebar

Related Questions

Possible Duplicate: Is this a good way to generate a string of random characters?
I am trying to optimize this query as good as possible,but still i am
Without going into whether this is a good or bad idea: Is it possible
I don't think this is currently possible or if it's even a good idea,
Is this possible? function testObj(testArg) { //Do obj stuff here } testObj.prototype.addFn = function()
Is this possible to use Ajax.Beginform with update target inside of ajax form. like
Is this possible if I click on an anchor link to simulate as if
Is this possible? My code works on Firefox. I can also get webkit to
Is this possible? I know how to do it from your own wall but
Is this possible to do? I want to ping or send some kind of

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.