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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:09:29+00:00 2026-05-25T03:09:29+00:00

I am trying to show the users current location with the default blue dot

  • 0

I am trying to show the users current location with the default blue dot in android. In my maps page I also have a layout that shows different points of interest. Im having trouble figuring out what to put for some of the variables and was wondering if someone could help me out.

This is what I’m using so far to show my location.

    Location location = locationManager
                    .getLastKnownLocation(bestProvider);
            try {

                GeoPoint myPoint2 = new GeoPoint(
                        (int) (location.getLatitude() * 1E6),
                        (int) (location.getLongitude() * 1E6));
                newoverlay.drawMyLocation(null, mapView, location, myPoint2,
                        1000);
                mapOverlays.add(newoverlay);
            } catch (NullPointerException e) {
                GeoPoint myPoint2 = new GeoPoint((int) (-1 * 1E6),
                        (int) (-1 * 1E6));
                **newoverlay.drawMyLocation(null, mapView, location, myPoint2,
                        1000);**
                mapOverlays.add(newoverlay);
            }

I’m not sure what to put as the Canvas so I placed it with null so that it would compile. I’m using the location from a location Manager and I have my geopoint from the location variable. I’m also unsure what the “when” parameter is supposed to be.

I was also wondering how the blue bubble knows to move with the person, does the picture update every x milliseconds depending on the “when” parameter?

So far the app isn’t crashing, but it is also not showing the blue dot at any location.
I’m sure I just need help with finding what the canvas parameter should be.

Thanks

  • 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-25T03:09:30+00:00Added an answer on May 25, 2026 at 3:09 am

    try this way in your map activity

    class CurOverlay extends Overlay {
            private GeoPoint pointToDraw;
    
            public void setPointToDraw(GeoPoint point) {
                pointToDraw = point;
            }
    
            public GeoPoint getPointToDraw() {
                return pointToDraw;
            }
    
            @Override
            public boolean draw(Canvas canvas, MapView curmapView, boolean shadow,
                    long when) {
                super.draw(canvas, curmapView, shadow);
    
                // convert point to pixels
                Point screenPts = new Point();
                curmapView.getProjection().toPixels(pointToDraw, screenPts);
    
                // add marker
                Bitmap bmp = BitmapFactory.decodeResource(getResources(),
                        R.drawable.pinsource);
                canvas.drawBitmap(bmp, screenPts.x - 28, screenPts.y - 48, null);
                return true;
            }
    
        }
    

    i hope this will work for 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 show wall posts that all users have made on a specific
I'm trying to get my current location and show it on a map. Class
I'm trying to redirect users that login to their profile page but get the
I am trying to show/hide a users twitter feed when the icon is clicked
I'm trying to show a list of all users but am unsure how to
I am trying to grab a users' IP address to show them content relevant
I want to show a message box when users trying to do any major
I am trying to loop though my users database to show each username in
I'm trying to show/hide a movieclip (or graphic) symbol that is on a layer
I am writing an app that requires the user's current location (lastknownlocation won't be

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.