Search in sources :

Example 1 with GroundOverlay

use of org.osmdroid.bonuspack.overlays.GroundOverlay in project android-sdk-examples by IndoorAtlas.

the class OpenStreetMapOverlay method setupGroundOverlay.

/**
 * Sets bitmap of floor plan as ground overlay on Open Street Map
 */
private void setupGroundOverlay(IAFloorPlan floorPlan, Bitmap bitmap) {
    if (mGroundOverlay != null) {
        mOsmv.getOverlays().remove(mGroundOverlay);
    }
    if (mOsmv != null) {
        IALatLng iaLatLng = floorPlan.getCenter();
        GroundOverlay overlay = new GroundOverlay();
        overlay.setImage(new BitmapDrawable(getResources(), bitmap));
        overlay.setPosition(new GeoPoint(iaLatLng.latitude, iaLatLng.longitude));
        overlay.setDimensions(floorPlan.getWidthMeters(), floorPlan.getHeightMeters());
        overlay.setBearing(floorPlan.getBearing());
        mGroundOverlay = overlay;
        mOsmv.getOverlays().add(mGroundOverlay);
    }
}
Also used : GeoPoint(org.osmdroid.util.GeoPoint) IALatLng(com.indooratlas.android.sdk.resources.IALatLng) BitmapDrawable(android.graphics.drawable.BitmapDrawable) GroundOverlay(org.osmdroid.bonuspack.overlays.GroundOverlay)

Aggregations

BitmapDrawable (android.graphics.drawable.BitmapDrawable)1 IALatLng (com.indooratlas.android.sdk.resources.IALatLng)1 GroundOverlay (org.osmdroid.bonuspack.overlays.GroundOverlay)1 GeoPoint (org.osmdroid.util.GeoPoint)1