File tree Expand file tree Collapse file tree 4 files changed +41
-3
lines changed
src/com/google/maps/android/utils/demo Expand file tree Collapse file tree 4 files changed +41
-3
lines changed Original file line number Diff line number Diff line change 57
57
<activity android : name =" .TileProviderAndProjectionDemo" />
58
58
<activity android : name =" .HeatmapsDemoActivity" />
59
59
<activity android : name =" .HeatmapsPlacesDemoActivity" />
60
+ <activity android : name =" .KMLDemoActivity" />
60
61
61
62
</application >
62
63
Original file line number Diff line number Diff line change @@ -30,9 +30,7 @@ private void setUpMapIfNeeded() {
30
30
return ;
31
31
}
32
32
mMap = ((SupportMapFragment ) getSupportFragmentManager ().findFragmentById (R .id .map )).getMap ();
33
- if (mMap != null ) {
34
- startDemo ();
35
- }
33
+
36
34
}
37
35
38
36
/**
Original file line number Diff line number Diff line change
1
+ package com .google .maps .android .utils .demo ;
2
+ import android .os .Bundle ;
3
+ import android .support .v4 .app .FragmentActivity ;
4
+
5
+ import com .google .android .gms .maps .GoogleMap ;
6
+ import com .google .android .gms .maps .SupportMapFragment ;
7
+
8
+ /**
9
+ * Created by lavenderc on 12/1/14.
10
+ */
11
+ public class KMLDemoActivity extends FragmentActivity {
12
+
13
+ private GoogleMap mMap ;
14
+
15
+ protected int getLayoutId () {
16
+ return R .layout .map ;
17
+ }
18
+
19
+ @ Override
20
+ public void onCreate (Bundle savedInstanceState ) {
21
+ super .onCreate (savedInstanceState );
22
+ setContentView (getLayoutId ());
23
+ setUpMapIfNeeded ();
24
+ }
25
+
26
+ @ Override
27
+ protected void onResume () {
28
+ super .onResume ();
29
+ setUpMapIfNeeded ();
30
+ }
31
+
32
+ private void setUpMapIfNeeded () {
33
+ if (mMap == null ) {
34
+ mMap = ((SupportMapFragment ) getSupportFragmentManager ().findFragmentById (R .id .map )).getMap ();
35
+ }
36
+ }
37
+
38
+ }
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ protected void onCreate(Bundle savedInstanceState) {
28
28
addDemo ("Generating tiles" , TileProviderAndProjectionDemo .class );
29
29
addDemo ("Heatmaps" , HeatmapsDemoActivity .class );
30
30
addDemo ("Heatmaps with Places API" , HeatmapsPlacesDemoActivity .class );
31
+ addDemo ("KML Layer Overlay" , KMLDemoActivity .class );
31
32
}
32
33
33
34
private void addDemo (String demoName , Class <? extends Activity > activityClass ) {
You can’t perform that action at this time.
0 commit comments