Skip to content

Commit c0e31d9

Browse files
author
Adrien Couque
committed
Ground Overlay demo
1 parent 2f76ec3 commit c0e31d9

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package com.airbnb.airmapview.sample;
2+
3+
import com.airbnb.android.airmapview.AirMapGroundOverlay;
4+
import com.google.android.gms.maps.model.LatLng;
5+
import com.google.android.gms.maps.model.LatLngBounds;
6+
7+
public class GroundOverlayDemoFragment extends BaseDemoFragment {
8+
@Override
9+
protected void startDemo() {
10+
getMap().addGroundOverlay(new AirMapGroundOverlay.Builder()
11+
.imageId(R.drawable.newark_nj_1922)
12+
.imageUrl("https://www.lib.utexas.edu/maps/historical/newark_nj_1922.jpg")
13+
.positionFromBounds(new LatLngBounds(new LatLng(40.712216, -74.22655), new LatLng(40.773941, -74.12544)))
14+
.build());
15+
16+
getMap().animateCenterZoom(new LatLng(40.740, -74.18), 12);
17+
}
18+
}

sample/src/main/java/com/airbnb/airmapview/sample/MainActivity.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ public BaseDemoFragment make() {
5959
return new DefaultDemoFragment();
6060
}
6161
});
62+
addDemo("Ground Overlay", new DemoFragmentFactory() {
63+
@Override
64+
public BaseDemoFragment make() {
65+
return new GroundOverlayDemoFragment();
66+
}
67+
});
6268

6369
startDemo(demos.get(0));
6470
}
140 KB
Loading

0 commit comments

Comments
 (0)