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

  • Home
  • SEARCH
  • 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 8431523
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:52:40+00:00 2026-06-10T05:52:40+00:00

Im creating an app where you can toggle the FollowLocation on and off using

  • 0

Im creating an app where you can toggle the FollowLocation on and off using MyLocationOverlay.

My problem is, when i’ve already set the MyLocationOverlay earlier, and want to turn on the FollowLocation, but i cant seem to find/get the MyLocationOverlay object in the MapView’s OverlayManager. The OverlayManager seems to only return an Overlay object, not the MyLocationOverlay object.

This is how i add the MyLocationOverlay:

main_mapView = (MapView) findViewById(R.id.main_mapView);   
MyLocationOverlay mMyLocationOverlay = new MyLocationOverlay(mContext, main_mapView);
mMyLocationOverlay.enableMyLocation();
mMyLocationOverlay.enableCompass();
mMyLocationOverlay.main_mapView.getOverlays().add(mMyLocationOverlay);
main_mapView.invalidate();

Later i would like to find the MyLocationOverlay doing something like this, but as mentioned it returns an Overlay object.

MyLocationOverlay mMyLocationOverlay = main_mapView.getOverlayManager().get(i);
mMyLocationOverlay.enableFollowLocation()

Anyone?

  • 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-10T05:52:42+00:00Added an answer on June 10, 2026 at 5:52 am

    Just keep a reference to the MyLocationOverlay you new initaly… No need to get it back from the overlay manager.

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

Sidebar

Related Questions

I am creating an app using html5 and java script and can convert into
Creating simple app using GAE / Django-nonrel (I don't think the problem is specific
I am creating an app and want to know if my app can send
I'm looking into creating a desktop and mobile app which can work together and
A single Rails command can make lots of changes in an app - creating
I am creating a Rails app for work and until I can install the
I am creating an app using iOS 5 SDK. I managed to push views
I am creating app where user can save options witch one is better? to
I'm interested in creating an iPhone app that can stream video from a central
I am in the process of creating an app in which a customer can

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.