Skip to content

Commit 79279d2

Browse files
author
Adrien Couque
committed
Ground Overlay demo
1 parent b7db2ac commit 79279d2

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
@@ -45,6 +45,12 @@ public BaseDemoFragment make() {
4545
return new DefaultDemoFragment();
4646
}
4747
});
48+
addDemo("Ground Overlay", new DemoFragmentFactory() {
49+
@Override
50+
public BaseDemoFragment make() {
51+
return new GroundOverlayDemoFragment();
52+
}
53+
});
4854

4955
startDemo(demos.get(0));
5056
}
140 KB
Loading

0 commit comments

Comments
 (0)