Java 类com.google.android.gms.maps.SupportMapFragment 实例源码

项目:2017.2-codigo    文件:MapActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_map);

    Intent i = getIntent();
    latitude  = i.getDoubleExtra(LAT_KEY,-8.047);
    longitude = i.getDoubleExtra(LON_KEY,-34.876);

    SupportMapFragment mapa = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.mapa);
    mapa.getMapAsync(this);

}
项目:Remindy    文件:LocationBasedReminderDetailFragment.java   
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.fragment_detail_reminder_location_based, container, false);

    mContainer = (LinearLayout) rootView.findViewById(R.id.fragment_reminder_location_based_container);
    mAddress = (TextView) rootView.findViewById(R.id.fragment_reminder_location_based_address);
    mAddress.setText(mReminder.getPlace().getAddress());
    mRadius = (TextView) rootView.findViewById(R.id.fragment_reminder_location_based_radius);
    mRadius.setText(String.format(Locale.getDefault(),
            getResources().getString(R.string.fragment_detail_location_based_reminder_radius),
            mReminder.getPlace().getRadius(),
            mReminder.getEnteringExitingString(getActivity())) );


    // Get the SupportMapFragment and request notification
    // when the map is ready to be used.
    SupportMapFragment mapFragment = (SupportMapFragment) getChildFragmentManager().findFragmentById(R.id.fragment_reminder_location_based_map);
    mapFragment.getMapAsync(this);
    return rootView;
}
项目:UbiBike-client    文件:MapsActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_maps);
    // Obtain the SupportMapFragment and get notified when the map is ready to be used.
    SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
            .findFragmentById(R.id.map);
    mapFragment.getMapAsync(MapsActivity.this);

    mPolyOpt.color(Color.LTGRAY);

    distance_value = (TextView) findViewById(R.id.distance_value);
    point_value = (TextView) findViewById(R.id.point_value);
    time_value = (TextView) findViewById(R.id.time_value);

}
项目:Viajes    文件:MapFragment.java   
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    View mRootView = inflater.inflate(R.layout.fragment_map,container,false);
    hotels = new ArrayList<>();


    SupportMapFragment mapFragment = (SupportMapFragment) getChildFragmentManager().findFragmentById(R.id.map_item);
    mapFragment.getMapAsync(this);

     recyclerView = (RecyclerView) mRootView.findViewById(R.id.map_recycler_view);
    recyclerView.setHasFixedSize(true);
    LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getActivity());
    linearLayoutManager.setOrientation(LinearLayout.HORIZONTAL);
    recyclerView.setLayoutManager(linearLayoutManager);
    recyclerView.setItemAnimator(new DefaultItemAnimator());
    mAdapter = new CardViewAdapter(hotels);
    mAdapter.setActionListner(this);
    recyclerView.setAdapter(mAdapter);

    if (mPresenter != null)
        mPresenter.loadHotels();


    return mRootView;
}
项目:civify-app    文件:CivifyMapTest.java   
@Test
public void testGetMapFragment() throws MapNotLoadedException {
    assertThat(mMap.isMapFragmentSet(), is(false));

    SupportMapFragment mapFragment = mMap.getMapFragment();
    assertThat(mapFragment, is(not(nullValue())));
    assertThat(mMap.isMapFragmentSet(), is(true));
    verify(mMap, atLeastOnce()).setMapFragment(mapFragment);

    when(mMap.isMapReady()).thenReturn(false);
    SupportMapFragment mapFragment2 = mMap.getMapFragment();
    assertThat(mapFragment2, is(not(sameInstance(mapFragment))));

    when(mMap.isMapReady()).thenReturn(true);
    assertThat(mMap.getMapFragment(), is(sameInstance(mapFragment2)));

    CivifyMarkers markers = mMap.getMarkers();
    mMap.outdateToBeRefreshed();
    assertThat(mMap.getMapFragment(), is(not(sameInstance(mapFragment2))));
    assertThat(mMap.getMarkers(), is(sameInstance(markers)));
    verify(mMap, never()).refreshIssues();
}
项目:Moodr    文件:MapsProfileActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_maps_profile);

    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);

    new NavDrawerSetup(this, toolbar).setupNav();

    SupportMapFragment mapFragment =
            (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.profile_map);
    mapFragment.getMapAsync(this);

    Intent intent = getIntent();
    // Get the list of the filtered moods from ProfileActivity
    profileFilteredMoods = (ArrayList<Mood>) intent.getSerializableExtra("profileFilteredList");
}
项目:Moodr    文件:MapsActivity.java   
/**
 * Flag indicating whether a requested permission has been denied after returning in
 * {@link #onRequestPermissionsResult(int, String[], int[])}.
 */


@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_maps);

    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);

    new NavDrawerSetup(this, toolbar).setupNav();

    SupportMapFragment mapFragment =
            (SupportMapFragment) getSupportFragmentManager().findFragmentById(map);
    mapFragment.getMapAsync(this);
}
项目:TrackIn-Android-Application    文件:GPSActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_maps);
    try {

        gpsTracker = new com.trackin.iodroid.trackin.GPSTracker(getApplicationContext());
        mLocation = gpsTracker.getLocation();

        latitude = mLocation.getLatitude();
        longitude = mLocation.getLongitude();
      /*  Geocoder geocoder = new Geocoder(this);
        geocoder.get*/
        // Obtain the SupportMapFragment and get notified when the map is ready to be used.
        SupportMapFragment
                mapFragment = (SupportMapFragment) getSupportFragmentManager()
                .findFragmentById(R.id.map);
        mapFragment.getMapAsync(this);
        System.out.println("60");
        lat = gpsTracker.getLocation().getLatitude();
        lng = gpsTracker.getLocation().getLongitude();

    } catch (Exception e) {
        Toast.makeText(GPSActivity.this,"GPS not enabled!",Toast.LENGTH_LONG);
    }
}
项目:GitJourney    文件:GeneralActivity.java   
@Override
public Fragment getItem(int position) {
    Log.v(TAG, "getItem, position = " + position);
    // getItem is called to instantiate the fragment for the given page.
    // Return a PlaceholderFragment (defined as a static inner class below).
    switch (position) {
        case 0:
            return FeedListFragment.newInstance();
        case 1:
            return RepositoriesListFragment.newInstance();
        case 2:
            return FollowingListFragment.newInstance();
        case 3:
            return FollowersListFragment.newInstance();
        case 4:
            return StarsListFragment.newInstance();
        case 5:
            LocationsReadyCallback callback = new LocationsReadyCallback(GeneralActivity.this);
            SupportMapFragment fragment = SupportMapFragment.newInstance();
            fragment.getMapAsync(callback);
            return fragment;
    }
    return PlaceholderFragment.newInstance(position + 1);
}
项目:marauders    文件:MapsActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_maps);
    ActivityCompat.requestPermissions(MapsActivity.this, new String[] {android.Manifest.permission.ACCESS_FINE_LOCATION}, 123);
    SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
            .findFragmentById(R.id.map);
    mapFragment.getMapAsync(this);
    GpsTracker gt = new GpsTracker(getApplicationContext());
    Location l = gt.getLocation();
    if( l == null){
        Toast.makeText(getApplicationContext(),"GPS unable to get Value",Toast.LENGTH_SHORT).show();
    }else {
        double lat = l.getLatitude();
        double lon = l.getLongitude();
        Toast.makeText(getApplicationContext(),"GPS Lat = "+lat+"\n lon = "+lon,Toast.LENGTH_SHORT).show();
    }
}
项目:LocationAware    文件:LocationAlarmActivity.java   
private void initView() {
  locationPin = findViewById(R.id.location_pin);
  currentLocationBtn = findViewById(R.id.my_location_btn);
  checkPointsListBtn = findViewById(R.id.check_points_list_btn);
  View bottomSheet = findViewById(R.id.bottom_sheet);
  mBottomSheetBehavior = BottomSheetBehavior.from(bottomSheet);
  mBottomSheetBehavior.setHideable(true);
  mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_HIDDEN);

  RecyclerView checkPointsList = findViewById(R.id.check_point_list_view);
  checkPointsList.setLayoutManager(new LinearLayoutManager(context));
  checkPointsList.setAdapter(checkPointsAdapter);
  autocompleteFragment = (PlaceAutocompleteFragment)
      getFragmentManager().findFragmentById(R.id.search_places_fragment);
  SupportMapFragment supportMapFragment =
      (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map);
  supportMapFragment.getMapAsync(this);
  bindEvents();
}
项目:Instincts-2k17    文件:MapsActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_maps);
    location = getIntent().getStringExtra("location");

    stringToLatLngMap = new HashMap<>();
    stringToLatLngMap.put("Main Auditorium", MAIN_AUDITORIUM);
    stringToLatLngMap.put("Main Stage", MAIN_STAGE);
    stringToLatLngMap.put("Mini Auditorium", MINI_AUDITORIUM);
    stringToLatLngMap.put("ECE Seminar Hall", ECE_SEMINAR_HALL);
    stringToLatLngMap.put("Central Seminar Hall", CENTRAL_SEMINAR_HALL);
    stringToLatLngMap.put("CSE Seminar Hall", CSE_SEMINAR_HALL);
    stringToLatLngMap.put("IT Seminar Hall", IT_SEMINAR_HALL);
    stringToLatLngMap.put("IT Classrooms", IT_CLASSROOMS);
    stringToLatLngMap.put("CSE Classrooms", CSE_CLASSROOMS);
    stringToLatLngMap.put("IT Labs", IT_LABS);
    stringToLatLngMap.put("Fountain", FOUNTAIN);
    stringToLatLngMap.put("Mech Seminar Hall", MECH_SEMINAR_HALL);
    stringToLatLngMap.put("Food Stalls", FOOD_STALL);

    mapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map);
    mapFragment.getMapAsync(this);
    attemptEnableMyLocation();
}
项目:HackJakRawan    文件:MapsActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_maps);

    SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
            .findFragmentById(R.id.maps_lokasi);
    mapFragment.getMapAsync(this);

    latitude = "-6.235510";
    longitude = "106.747263";

    toolbar = (Toolbar) findViewById(R.id.tool_bar); // Attaching the layout to the toolbar object
    toolbar.setLogoDescription(getResources().getString(R.string.sign_up_title));
    toolbar.setTitleTextColor(getResources().getColor(R.color.title));
    toolbar.setTitle("Rawan");
}
项目:maklib    文件:MapsActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    FontAwesome.apply();
    setContentView(R.layout.activity_maps);
    // Obtain the SupportMapFragment and get notified when the map is ready to be used.
    SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
            .findFragmentById(R.id.map);
    mapFragment.getMapAsync(this);

    permissions = new Permissions(this);
    dialogView = new DialogView(this);
    locationButton = (Button) findViewById(R.id.location);
    locationButton.setOnClickListener(this);
    save = (TextView) findViewById(R.id.save);
    save.setOnClickListener(this);
}
项目:iSPY    文件:MapsActivity2.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_maps2);
    checkLocationPermission();


    //Check if Google Play Services Available or not
    if (!CheckGooglePlayServices()) {
        Log.d("onCreate", "Finishing test case since Google Play Services are not available");
        finish();
    }
    else {
        Log.d("onCreate","Google Play Services available.");
    }

    // Obtain the SupportMapFragment and get notified when the map is ready to be used.
    SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
            .findFragmentById(R.id.map);
    mapFragment.getMapAsync(this);
}
项目:iSPY    文件:MapsActivity3.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_maps2);
    checkLocationPermission();

    Intent i = getIntent();
    ArrayList<LatLng> list1 = i.getParcelableArrayListExtra("key0");
    LatLng l=list1.get(0);
    latitude1=l.latitude;
    longitude1=l.longitude;

    //Check if Google Play Services Available or not
    if (!CheckGooglePlayServices()) {
        Log.d("onCreate", "Finishing test case since Google Play Services are not available");
        finish();
    }
    else {
        Log.d("onCreate","Google Play Services available.");
    }

    // Obtain the SupportMapFragment and get notified when the map is ready to be used.
    SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
            .findFragmentById(R.id.map);
    mapFragment.getMapAsync(this);
}
项目:Taxi-App-Android-XML    文件:Home.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_home);
    setTitleHome(R.id.toolbar, R.id.iv_title, R.drawable.ic_burger, R.drawable.logo_actbar);

    SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
            .findFragmentById(R.id.map);
    mapFragment.getMapAsync(this);

    btn_request = (Button) findViewById(R.id.bt_request);
    btn_request.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            startActivity(new Intent(Home.this, SelectDriver.class));
        }
    });
}
项目:BonAppetit_Android-Project    文件:MapsActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_maps);

    // Obtain the SupportMapFragment and get notified when the map is ready to be used.
    SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
            .findFragmentById(R.id.map);
    mapFragment.getMapAsync(this);
    //preparing GoogleApiClient
    mGoogleApiClient=new GoogleApiClient.Builder(this)
            .addApi(Places.GEO_DATA_API)
            .build();
    mGoogleApiClient.connect();
    //Yes! finally Firebase :P
    Firebase.setAndroidContext(this);
    mFirebase=new Firebase(FIREBASE_URL);
    mFirebase.child(FIREBASE_ROOT_NODE).addChildEventListener(this);

}
项目:treetracker-android    文件:MapsFragment.java   
@Override
public void onDestroyView() {
    super.onDestroyView();

    try {
        SupportMapFragment fragment = (SupportMapFragment) getActivity()
                .getSupportFragmentManager().findFragmentById(
                        R.id.map);
        if (fragment != null)
            getActivity().getSupportFragmentManager().beginTransaction().remove(fragment).commit();

    } catch (IllegalStateException e) {
        //handle this situation because you are necessary will get
        //an exception here :-(
    }
}
项目:MedicalMe    文件:MapsActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);


    // Retrieve location and camera position from saved instance state.
    if (savedInstanceState != null) {
        mCurrentLocation = savedInstanceState.getParcelable(KEY_LOCATION);
        mCameraPosition = savedInstanceState.getParcelable(KEY_CAMERA_POSITION);
    }

    setContentView(R.layout.activity_maps);

    //---------------------add maps fragments-----------------------
    // Obtain the SupportMapFragment and get notified when the map is ready to be used.
    SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
            .findFragmentById(map);
    mapFragment.getMapAsync(this);

    //build Google place API
    buildGoogleApiClient();
    mGoogleApiClient.connect();
}
项目:app_secompufscar    文件:MapsActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_maps);
    // Obtain the SupportMapFragment and get notified when the map is ready to be used.
    SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
            .findFragmentById(R.id.map);
    mapFragment.getMapAsync(this);

    Intent intent = getIntent();
    if(intent != null){
        Bundle params = intent.getExtras();
        if(params != null){
            Local = params.getInt("Local");
        }
    }
}
项目:GoogleMapsApp    文件:MapsActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    //checkLocationPharmacy();
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_maps);

    Button button = (Button) findViewById(R.id.button);
    button.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            new FetchWebsiteData().execute();
        }
    });

    if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
        checkLocationPermission();
    }
    // Obtain the SupportMapFragment and get notified when the map is ready to be used.
    SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
            .findFragmentById(R.id.map);

    mapFragment.getMapAsync(this);
}
项目:CIA    文件:ViewEventsMapActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_view_nearby_events);

    events = (List<CompletedEventDisplay>) getIntent().getSerializableExtra(ID_EVENTS);

    // Obtain the SupportMapFragment and get notified when the map is ready to be used.
    SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
            .findFragmentById(R.id.map);
    mapFragment.getMapAsync(this);
}
项目:nongbeer-mvp-android-demo    文件:MapActivity.java   
@Override
public void bindView(){
    btnBack = (ImageView) findViewById( R.id.btn_back );
    btnOrder = (Button) findViewById( R.id.btn_order );
    cardLoading = (CardView) findViewById( R.id.card_loading );
    mapFragment = (SupportMapFragment) getSupportFragmentManager()
            .findFragmentById( R.id.map );
}
项目:MapaDeIgarassuAdmin    文件:HomeActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.home_activity);

    /*SupportMapFragment ==> Mapa*/
    SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
            .findFragmentById(map);
    mapFragment.getMapAsync(this);

    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);

    DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
    ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
            this, drawer, toolbar, 0, 0);
    drawer.setDrawerListener(toggle);
    toggle.syncState();

    NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
    navigationView.setNavigationItemSelectedListener(this);

    /*Inflate para o pop-up dos markers(Janela em cima do marker)*/
    this.markerView = getLayoutInflater().inflate(R.layout.marker_view, null);

    invokeAddMarkerMapOther = new InvokeAddMarkerMapOther(this.context);

}
项目:UbiBike-client    文件:DisplayRoute.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_display_route);
    // Obtain the SupportMapFragment and get notified when the map is ready to be used.
    SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map);
    mapFragment.getMapAsync(this);

    Intent i = getIntent();
    checkingStation = i.getExtras().getBoolean("checkingStation");

    //Trajectory to print
    List<LatLng> wrap = (List<LatLng>) i.getSerializableExtra("Trajectory");

    if(wrap != null)
    {
        try {
            addToJSONArray(track,wrap);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    else if(!checkingStation)
    {
        Snackbar.make(findViewById(android.R.id.content), "Unable to retrieve path information.", Snackbar.LENGTH_LONG).setAction("Action", null).show();
    }

    stationPos = new LatLng(i.getExtras().getFloat("latitude"),i.getExtras().getFloat("longitude"));

}
项目:android-ponewheel    文件:RideDetailActivity.java   
private void setupMap() {
    mapCameraPadding = getResources().getDimensionPixelSize(R.dimen.map_camera_padding);

    // Get the SupportMapFragment and request notification
    // when the map is ready to be used.
    mapFragment = (SupportMapFragment) getSupportFragmentManager()
            .findFragmentById(R.id.map);
    mapFragment.getMapAsync(this);
}
项目:ExtraMapUtils    文件:MapsActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_maps);
    SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
            .findFragmentById(R.id.map);
    Bundle bundle = getIntent().getParcelableExtra("args");
    viewOption = bundle.getParcelable("optionView");
    mapFragment.getMapAsync(this);
}
项目:Android-Developer-Path    文件:Main2Activity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main2);

    getLocation();

    SupportMapFragment mapFragment =
            (SupportMapFragment) getSupportFragmentManager()
            .findFragmentById(R.id.gmap);
    mapFragment.getMapAsync(this);
}
项目:Android-Developer-Path    文件:MapsActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_maps);
    // Obtain the SupportMapFragment and get notified when the map is ready to be used.
    SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
            .findFragmentById(R.id.map);
    mapFragment.getMapAsync(this);
}
项目:apps_small    文件:MapsActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_maps);
    // Obtain the SupportMapFragment and get notified when the map is ready to be used.
    SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
            .findFragmentById(R.id.map);
    mapFragment.getMapAsync(this);
}
项目:nirbhaya    文件:NirbhayaMapsActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_nirbhaya_maps);
    // Obtain the SupportMapFragment and get notified when the map is ready to be used.
    SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
            .findFragmentById(R.id.map);
    mapFragment.getMapAsync(this);
}
项目:apps_small    文件:MapsActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_maps);
    // Obtain the SupportMapFragment and get notified when the map is ready to be used.
    SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
            .findFragmentById(R.id.map);
    mapFragment.getMapAsync(this);

    localM = (LocationManager) getSystemService(Context.LOCATION_SERVICE);

    myProvider = localM.getBestProvider(new Criteria(), false);

    if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {

        return;
    }
    myLocation = localM.getLastKnownLocation(myProvider);

    if (myLocation != null) {

        Log.i("WJH", myLocation.toString());

    } else {

        Log.i("WJH", "Location is null.");

    }
}
项目:VR-One    文件:MapActivity.java   
private void setUpMapIfNeeded() {
    if (mMap == null) {
        ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map))
                .getMapAsync(new OnMapReadyCallback() {
                    @Override
                    public void onMapReady(GoogleMap googleMap) {
                        mMap = googleMap;
                        setUpMap();
                    }
                });
    }
}
项目:Nibo    文件:BaseNiboFragment.java   
protected void initmap() {
    SupportMapFragment mapFragment = (SupportMapFragment) getChildFragmentManager()
            .findFragmentById(R.id.map);
    mapFragment.getMapAsync(this);

    mLocationRepository = new LocationRepository(getActivity(), mGoogleApiClient);

    mLocationRepository.getLocationObservable()
            .subscribe(new Consumer<Location>() {
                @Override
                public void accept(@NonNull Location location) throws Exception {
                    CameraPosition cameraPosition = new CameraPosition.Builder()
                            .target(new LatLng(location.getLatitude(), location.getLongitude()))
                            .zoom(15)
                            .build();
                    mMap.moveCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));
                    handleLocationRetrieval(location);
                    extractGeocode(location.getLatitude(), location.getLongitude());

                }
            }, new Consumer<Throwable>() {
                @Override
                public void accept(@NonNull Throwable throwable) throws Exception {
                    throwable.printStackTrace();
                }
            });


}
项目:civify-app    文件:CivifyMap.java   
private static SupportMapFragment newMapFragment() {
    return SupportMapFragment.newInstance(new GoogleMapOptions()
            .camera(new CameraPosition.Builder()
                    .target(LocationAdapter.ZERO)
                    .zoom(DEFAULT_ZOOM)
                    .build()));
}
项目:IelloAndroidAdminApp    文件:MappaGoogle.java   
/**
 * Costruttore della classe. Inizializza i componenti della mappa.
 */
public MappaGoogle(MainActivity a) {
    mMainActivity = a;

    // inizializza la mappa
    final SupportMapFragment mapFragment =
            (SupportMapFragment) a.getSupportFragmentManager().findFragmentById(R.id.map);
    mapFragment.getMapAsync(this);


    // verifica se si dispone dell'autorizzazione alla posizione, ed eventualmente la chiede.
    // Per le versioni di android precedenti a M, il permesso è confermato automaticamente
    if (ActivityCompat.checkSelfPermission(mMainActivity,
            android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED
     && ActivityCompat.checkSelfPermission(mMainActivity,
            android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED
     && Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {

            mMainActivity.requestPermissions(new String[]
                            {android.Manifest.permission.ACCESS_FINE_LOCATION,
                             android.Manifest.permission.ACCESS_COARSE_LOCATION},
                    PERMISSION_CODE);

    } else {
        mGeoPermessoDisponibile = true;
    }

    // inizializza i servizi di localizzazione google
    mLocationProvider = LocationServices.getFusedLocationProviderClient(mMainActivity);
}
项目:MyCalendar    文件:MapsActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_maps);
    // Obtain the SupportMapFragment and get notified when the map is ready to be used.
    SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
            .findFragmentById(R.id.map);
    mapFragment.getMapAsync(this);
}
项目:wheretomeet-android    文件:MapsActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_maps);

    SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map);
    mapFragment.getMapAsync(this);
}
项目:android-googlemaps    文件:MainActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    // Obtain the SupportMapFragment and get notified when the map is ready to be used.
    SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
            .findFragmentById(R.id.map);
    mapFragment.getMapAsync(this);
}