I am using the OSM for a mapping application where I
rotate the map in direction of travel as explained here Android Rotating MapView . This works well.
However, I haven’t yet managed to adjust the dispatchTouchEvent code
to counter the map rotation effect for the user touches (right now
when the map is rotated 90 degrees a user’s horizontal sweep will move
the map vertically etc). The sample code only offers the teaser:
public boolean dispatchTouchEvent(MotionEvent ev) {
// TODO: rotate events too
return super.dispatchTouchEvent(ev);
}
Any guidance would be appreciated.
And while I am at it – Is it still possible to position the zoom
controls separately, so that they do NOT rotate when the map rotates?
I read that the getZoomControls() is deprecated. (Why ?)
I know it’s too late but it may help someone…
import org.osmdroid.views.overlay.MyLocationOverlay;
now just use this Relative Layout in your xml like this:-
And add Map View Programatially like this:-
here mParent is Context. And one more thing if you encounter Image Pixelation prob you just have to use it
Hope i explained it as good as i could…. feel free to ask if you find problem understanding it.
Thanks.