use of com.google.android.libraries.maps.OnStreetViewPanoramaReadyCallback in project android-samples by googlemaps.
the class StreetViewPanoramaBasicDemoActivity method onCreate.
@Override
protected void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.street_view_panorama_basic_demo);
SupportStreetViewPanoramaFragment streetViewPanoramaFragment = (SupportStreetViewPanoramaFragment) getSupportFragmentManager().findFragmentById(R.id.streetviewpanorama);
streetViewPanoramaFragment.getStreetViewPanoramaAsync(new OnStreetViewPanoramaReadyCallback() {
@Override
public void onStreetViewPanoramaReady(StreetViewPanorama panorama) {
// loaded which is when the savedInstanceState is null).
if (savedInstanceState == null) {
panorama.setPosition(SYDNEY);
}
}
});
}
use of com.google.android.libraries.maps.OnStreetViewPanoramaReadyCallback in project android-samples by googlemaps.
the class StreetViewPanoramaNavigationDemoActivity method onCreate.
@Override
protected void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.street_view_panorama_navigation_demo);
SupportStreetViewPanoramaFragment streetViewPanoramaFragment = (SupportStreetViewPanoramaFragment) getSupportFragmentManager().findFragmentById(R.id.streetviewpanorama);
streetViewPanoramaFragment.getStreetViewPanoramaAsync(new OnStreetViewPanoramaReadyCallback() {
@Override
public void onStreetViewPanoramaReady(StreetViewPanorama panorama) {
mStreetViewPanorama = panorama;
// loaded which is when the savedInstanceState is null).
if (savedInstanceState == null) {
mStreetViewPanorama.setPosition(SYDNEY);
}
}
});
mCustomDurationBar = (SeekBar) findViewById(R.id.duration_bar);
}
use of com.google.android.libraries.maps.OnStreetViewPanoramaReadyCallback in project android-samples by googlemaps.
the class SplitStreetViewPanoramaAndMapDemoActivity method onCreate.
@Override
protected void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.split_street_view_panorama_and_map_demo);
final LatLng markerPosition;
if (savedInstanceState == null) {
markerPosition = SYDNEY;
} else {
markerPosition = savedInstanceState.getParcelable(MARKER_POSITION_KEY);
}
SupportStreetViewPanoramaFragment streetViewPanoramaFragment = (SupportStreetViewPanoramaFragment) getSupportFragmentManager().findFragmentById(R.id.streetviewpanorama);
streetViewPanoramaFragment.getStreetViewPanoramaAsync(new OnStreetViewPanoramaReadyCallback() {
@Override
public void onStreetViewPanoramaReady(StreetViewPanorama panorama) {
streetViewPanorama = panorama;
streetViewPanorama.setOnStreetViewPanoramaChangeListener(SplitStreetViewPanoramaAndMapDemoActivity.this);
// its state.
if (savedInstanceState == null) {
streetViewPanorama.setPosition(SYDNEY);
}
}
});
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map);
mapFragment.getMapAsync(new OnMapReadyCallback() {
@Override
public void onMapReady(GoogleMap map) {
map.setOnMarkerDragListener(SplitStreetViewPanoramaAndMapDemoActivity.this);
// Creates a draggable marker. Long press to drag.
marker = map.addMarker(new MarkerOptions().position(markerPosition).icon(BitmapDescriptorFactory.fromResource(R.drawable.pegman)).draggable(true));
}
});
}
Aggregations