Reputation: 147
I'm trying out the info balloon from: https://github.com/jgilfelt/android-mapviewballoons and it's working perfectly. One thing I'm missing is the ability of setting the current location. Does anybody know how to precisely implement that function? Thanks in advance !
Upvotes: 0
Views: 310
Reputation: 2748
Yes, for example I have some url variable which I display in baloon and my onBaloonTap looks like this, where c is context
@Override
protected boolean onBalloonTap(int index, OverlayItem item) {
String url = WebService.upcomigEvent;
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
c.startActivity(i);
return true;
}
Upvotes: 2
Reputation: 1593
You can track position by implementing the LocationListener interface, or by using the MyLocationOverlay class. In both, the method onLocationChanged
is available, and you can provide it with your own location object that you create, specifying the lat/lng/alt. This in effect 'spoofs' the users location, and this might not be what you want. If you just want to scroll the map to a specific point you can use the animateTo
method available in the MapController.
Upvotes: 0