use of com.google.android.libraries.maps.SupportMapFragment in project android-samples by googlemaps.
the class CloudBasedMapStylingDemoActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (savedInstanceState != null) {
currentMapType = savedInstanceState.getInt(MAP_TYPE_KEY);
}
// The underlying style the map will use has been set in the layout
// `cloud_styling_basic_demo` under the SupportMapFragment's `map:mapId` attribute.
setContentView(R.layout.cloud_styling_basic_demo);
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map);
mapFragment.getMapAsync(this);
setUpButtonListeners();
}
use of com.google.android.libraries.maps.SupportMapFragment in project android-samples by googlemaps.
the class StyledMapDemoActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (savedInstanceState != null) {
mSelectedStyleId = savedInstanceState.getInt(SELECTED_STYLE);
}
setContentView(R.layout.styled_map_demo);
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map);
mapFragment.getMapAsync(this);
}
use of com.google.android.libraries.maps.SupportMapFragment in project android-samples by googlemaps.
the class UiSettingsDemoActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.ui_settings_demo);
mMyLocationButtonCheckbox = (CheckBox) findViewById(R.id.mylocationbutton_toggle);
mMyLocationLayerCheckbox = (CheckBox) findViewById(R.id.mylocationlayer_toggle);
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map);
mapFragment.getMapAsync(this);
}
use of com.google.android.libraries.maps.SupportMapFragment in project android-samples by googlemaps.
the class VisibleRegionDemoActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.visible_region_demo);
mMessageView = (TextView) findViewById(R.id.message_text);
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map);
new OnMapAndViewReadyListener(mapFragment, this);
}
use of com.google.android.libraries.maps.SupportMapFragment in project android-samples by googlemaps.
the class ProgrammaticDemoActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// It isn't possible to set a fragment's id programmatically so we set a tag instead and
// search for it using that.
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentByTag(MAP_FRAGMENT_TAG);
// We only create a fragment if it doesn't already exist.
if (mapFragment == null) {
// To programmatically add the map, we first create a SupportMapFragment.
mapFragment = SupportMapFragment.newInstance();
// Then we add it using a FragmentTransaction.
FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
fragmentTransaction.add(android.R.id.content, mapFragment, MAP_FRAGMENT_TAG);
fragmentTransaction.commit();
}
mapFragment.getMapAsync(this);
}
Aggregations