- private void draw_bitmap(AltosLatLon lat_lon, Bitmap bitmap, int off_x, int off_y) {
- if (lat_lon != null) {
- AltosPointInt pt = new AltosPointInt(map.transform.screen(lat_lon));
-
- canvas.drawBitmap(bitmap, pt.x - off_x, pt.y - off_y, paint);
- }
- }
-
- class MapView extends View implements ScaleGestureDetector.OnScaleGestureListener {
-
- ScaleGestureDetector scale_detector;
- boolean scaling;
-
- private void draw_positions() {
- if (map.last_position != null && here != null) {
- AltosPointDouble rocket_screen = map.transform.screen(map.last_position);
- AltosPointDouble here_screen = map.transform.screen(here);
- paint.setColor(0xff8080ff);
- canvas.drawLine((float) rocket_screen.x, (float) rocket_screen.y,
- (float) here_screen.x, (float) here_screen.y, paint);
- }
- draw_bitmap(pad, pad_bitmap, pad_off_x, pad_off_y);
- draw_bitmap(map.last_position, rocket_bitmap, rocket_off_x, rocket_off_y);
- draw_bitmap(here, here_bitmap, here_off_x, here_off_y);
- }