Search in sources :

Example 21 with SupportMapFragment

use of com.google.android.libraries.maps.SupportMapFragment in project android-samples by googlemaps.

the class RetainMapDemoActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.basic_demo);
    SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map);
    if (savedInstanceState == null) {
        // First incarnation of this activity.
        mapFragment.setRetainInstance(true);
    }
    mapFragment.getMapAsync(this);
}
Also used : SupportMapFragment(com.google.android.libraries.maps.SupportMapFragment)

Example 22 with SupportMapFragment

use of com.google.android.libraries.maps.SupportMapFragment 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));
        }
    });
}
Also used : SupportMapFragment(com.google.android.libraries.maps.SupportMapFragment) StreetViewPanorama(com.google.android.libraries.maps.StreetViewPanorama) MarkerOptions(com.google.android.libraries.maps.model.MarkerOptions) OnStreetViewPanoramaReadyCallback(com.google.android.libraries.maps.OnStreetViewPanoramaReadyCallback) GoogleMap(com.google.android.libraries.maps.GoogleMap) OnMapReadyCallback(com.google.android.libraries.maps.OnMapReadyCallback) LatLng(com.google.android.libraries.maps.model.LatLng) SupportStreetViewPanoramaFragment(com.google.android.libraries.maps.SupportStreetViewPanoramaFragment)

Example 23 with SupportMapFragment

use of com.google.android.libraries.maps.SupportMapFragment in project android-samples by googlemaps.

the class TagsDemoActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.tags_demo);
    mTagText = (TextView) findViewById(R.id.tag_text);
    SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map);
    new OnMapAndViewReadyListener(mapFragment, this);
}
Also used : SupportMapFragment(com.google.android.libraries.maps.SupportMapFragment)

Example 24 with SupportMapFragment

use of com.google.android.libraries.maps.SupportMapFragment in project android-samples by googlemaps.

the class TileCoordinateDemoActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.tile_coordinate_demo);
    SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map);
    mapFragment.getMapAsync(this);
}
Also used : SupportMapFragment(com.google.android.libraries.maps.SupportMapFragment)

Example 25 with SupportMapFragment

use of com.google.android.libraries.maps.SupportMapFragment in project android-samples by googlemaps.

the class TileOverlayDemoActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.tile_overlay_demo);
    mTransparencyBar = (SeekBar) findViewById(R.id.transparencySeekBar);
    mTransparencyBar.setMax(TRANSPARENCY_MAX);
    mTransparencyBar.setProgress(0);
    SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map);
    mapFragment.getMapAsync(this);
}
Also used : SupportMapFragment(com.google.android.libraries.maps.SupportMapFragment)

Aggregations

SupportMapFragment (com.google.android.libraries.maps.SupportMapFragment)27 RadioGroup (android.widget.RadioGroup)1 OnCheckedChangeListener (android.widget.RadioGroup.OnCheckedChangeListener)1 FragmentTransaction (androidx.fragment.app.FragmentTransaction)1 GoogleMap (com.google.android.libraries.maps.GoogleMap)1 OnMapReadyCallback (com.google.android.libraries.maps.OnMapReadyCallback)1 OnStreetViewPanoramaReadyCallback (com.google.android.libraries.maps.OnStreetViewPanoramaReadyCallback)1 StreetViewPanorama (com.google.android.libraries.maps.StreetViewPanorama)1 SupportStreetViewPanoramaFragment (com.google.android.libraries.maps.SupportStreetViewPanoramaFragment)1 LatLng (com.google.android.libraries.maps.model.LatLng)1 MarkerOptions (com.google.android.libraries.maps.model.MarkerOptions)1