venkivenkat / osmdroid

Automatically exported from code.google.com/p/osmdroid
0 stars 0 forks source link

Listener for follow location (MyLocationOverlay) #375

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Proposed enhancement:
- when follow location is enabled, this will automatically become disabled when 
the user scrolls somwhere else
- it would be good to have an option of getting notified when this happens

For example: look at the button/icon in Google Maps that enables the same 
functionality. It changes as follow location is turned on/off. The proposed 
enhancement would allow for the same function.

What version of the product are you using? On what operating system?
Latest trunk.

Please provide any additional information below.
The attached patch provides an interface and implements the observer pattern to 
allow an app to subscribe to changes in follow location status.

Usage:
    locationOverlay.addFollowMyLocationListener(new FollowMyLocationListener() {
      public void followMyLocationEnabled() {
        // TODO Auto-generated method stub
      }

      public void followMyLocationDisabled() {
        // TODO Auto-generated method stub
      }
    });

Original issue reported on code.google.com by osei...@gmail.com on 9 Oct 2012 at 6:55

GoogleCodeExporter commented 9 years ago
Sorry, forgot to attach the patch

Original comment by osei...@gmail.com on 15 Oct 2012 at 2:55

Attachments:

GoogleCodeExporter commented 9 years ago
You can create you own class that extends the MyLocationOverlay to achieve what 
you are looking for. Override the enableFollowLocation() and 
disableFollowLocation() methods.

Original comment by kurtzm...@gmail.com on 3 Jan 2013 at 7:57

GoogleCodeExporter commented 9 years ago
Sure, that's what I do at the moment. Still think it would be advantageous for 
others would want to achieve the same thing. Adding it to MyLocationOverlay 
does not hurt anyone who is not using it.

Original comment by osei...@gmail.com on 3 Jan 2013 at 11:14