Well, since no one answered, I will answer myself. This works fine:
public static void panMap (int x, int y, MapView map) {
Point ptPixels = new Point();
GeoPoint geoPt = map.getMapCenter();
Projection projection = map.getProjection();
projection.toPixels(geoPt, ptPixels);
ptPixels.x += x;
ptPixels.y += y;
geoPt = projection.fromPixels(ptPixels.x, ptPixels.y);
map.getController().animateTo(geoPt);
}
source
share