Fork me on GitHub

Introduction

Added in version 6.0.0 of osmdroid, the Ground Overlay class lets you plot an image on the map if you know the lat/lon coordinates of the four corners of the image.

Use Cases

Satellite imagery, weather/radar, etc

Usage

This is pretty straightforward. Create the class, set the image and the points (upper left, lower right). The overlay will stretch and shrink the image as needed.

GroundOverlay2 overlay = new GroundOverlay2();
overlay.setTransparency(0.5f);
overlay.setImage(bitmap);
overlay.setPosition(new GeoPoint(50.0,-127.5), new GeoPoint( 21.0, -66.5));
mMapView.getOverlayManager().add(overlay);