Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting location of the MyLocationOverlay marker #25

Open
RobGThai opened this issue Nov 23, 2012 · 4 comments
Open

Getting location of the MyLocationOverlay marker #25

RobGThai opened this issue Nov 23, 2012 · 4 comments

Comments

@RobGThai
Copy link

I couldn't find a way to get the location of MyLocationOverlay marker. For the time being, I hacked this into PolarisMapView. Not sure if this is omitted on purpose but since PolarisMapView wraps MyLocationOverlay into it so I think adding this will simplify the usage a little bit. Or should we rely on LocationListener instead?

/**
 * Return current location of {@link MyLocationOverlay}.
 * @return GeoPoint or null if disabled.
 */
public GeoPoint getMyLocation(){
    if(mMyLocationOverlay != null){
        return mMyLocationOverlay.getMyLocation();
    }
    return null;
}
@cyrilmottier
Copy link
Owner

This is something that should be available indeed.

@RobGThai
Copy link
Author

I am planning to add interface to access MyLocationOverlay's callback method such as runOnFirstFix, onSensorChanged, onTap, etc. Will it over complicate the simple API in Polaris?

I'm looking into two ways of doing this, interface with a bunch of callbacks inside. Or persist mMyLocationOverlay object in PolarisMapView then add a method to return the object for others to use it on their own.

Do you have any suggestion? I'm unsure if the latter way would introduce any leak if someone did not handle it properly?

@cyrilmottier
Copy link
Owner

I don't think replicating the MyLocationOverlay's API in PolarisMapView is a great option. When I released Polaris, I removed two methods that was here at the beginning. I still have to think about the consequences but I think having a factory to create a MyLocationOverlay or simply exposing it is a good option.

@fvisticot
Copy link

+1 to get MyLocationOverlay location !!! would be very useful !!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants