当前位置: 首页>>代码示例>>Java>>正文


Java SupportMapFragment.getMapAsync方法代码示例

本文整理汇总了Java中com.google.android.gms.maps.SupportMapFragment.getMapAsync方法的典型用法代码示例。如果您正苦于以下问题:Java SupportMapFragment.getMapAsync方法的具体用法?Java SupportMapFragment.getMapAsync怎么用?Java SupportMapFragment.getMapAsync使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.android.gms.maps.SupportMapFragment的用法示例。


在下文中一共展示了SupportMapFragment.getMapAsync方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getItem

import com.google.android.gms.maps.SupportMapFragment; //导入方法依赖的package包/类
@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);
}
 
开发者ID:OlgaKuklina,项目名称:GitJourney,代码行数:25,代码来源:GeneralActivity.java

示例2: onCreate

import com.google.android.gms.maps.SupportMapFragment; //导入方法依赖的package包/类
@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();
}
 
开发者ID:Francescopaolo44,项目名称:MedicalMe,代码行数:24,代码来源:MapsActivity.java

示例3: onCreate

import com.google.android.gms.maps.SupportMapFragment; //导入方法依赖的package包/类
@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);

}
 
开发者ID:agarwal-akash,项目名称:BonAppetit_Android-Project,代码行数:21,代码来源:MapsActivity.java

示例4: onCreate

import com.google.android.gms.maps.SupportMapFragment; //导入方法依赖的package包/类
@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();
}
 
开发者ID:adithya321,项目名称:Instincts-2k17,代码行数:26,代码来源:MapsActivity.java

示例5: onConnected

import com.google.android.gms.maps.SupportMapFragment; //导入方法依赖的package包/类
/**
 * Builds the map when the Google Play services client is successfully connected.
 */
@Override
public void onConnected(Bundle connectionHint) {
    // Get the SupportMapFragment and request notification
    // when the map is ready to be used.
    SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
            .findFragmentById(R.id.activity_place_map);
    mapFragment.getMapAsync(this);
}
 
开发者ID:abicelis,项目名称:Remindy,代码行数:12,代码来源:PlaceActivity.java

示例6: onCreate

import com.google.android.gms.maps.SupportMapFragment; //导入方法依赖的package包/类
@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"));

}
 
开发者ID:carlosfaria94,项目名称:UbiBike-client,代码行数:31,代码来源:DisplayRoute.java

示例7: onActivityCreated

import com.google.android.gms.maps.SupportMapFragment; //导入方法依赖的package包/类
@Override
public void onActivityCreated(Bundle savedInstanceState) {
	super.onActivityCreated(savedInstanceState);
	FragmentManager fm = getChildFragmentManager();
	SupportMapFragment mapFragment = (SupportMapFragment) fm.findFragmentById(R.id.map);
	mapFragment.getMapAsync(this);
}
 
开发者ID:micromasterandroid,项目名称:androidadvanced,代码行数:8,代码来源:PhotoMapFragment.java

示例8: onCreate

import com.google.android.gms.maps.SupportMapFragment; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_map);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);

    // 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);


    FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
    fab.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
                    .setAction("Action", null).show();
        }
    });

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

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


    // Initialize wifi manager and wifi receiver for onCreate.
    wifiManager = (WifiManager) getApplicationContext().getSystemService(Context.WIFI_SERVICE);
    receiver = new WifiReceiver(wifiManager, this);

    this.requestPermissions();
}
 
开发者ID:ProjectIndoor,项目名称:projectindoorapp,代码行数:40,代码来源:MapActivity.java

示例9: onCreate

import com.google.android.gms.maps.SupportMapFragment; //导入方法依赖的package包/类
@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);
}
 
开发者ID:team-htbr,项目名称:1617PROJ1Bloeddonatie-app,代码行数:10,代码来源:MapsActivity.java

示例10: onCreate

import com.google.android.gms.maps.SupportMapFragment; //导入方法依赖的package包/类
@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);
}
 
开发者ID:alaskalinuxuser,项目名称:apps_small,代码行数:10,代码来源:MapsActivity.java

示例11: initmap

import com.google.android.gms.maps.SupportMapFragment; //导入方法依赖的package包/类
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();
                }
            });


}
 
开发者ID:aliumujib,项目名称:Nibo,代码行数:30,代码来源:BaseNiboFragment.java

示例12: onConnected

import com.google.android.gms.maps.SupportMapFragment; //导入方法依赖的package包/类
/**
 * Builds the map when the Google Play services client is successfully connected.
 */
@Override
public void onConnected(Bundle connectionHint) {
    // Build the map.
    SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
            .findFragmentById(R.id.map);
    mapFragment.getMapAsync(this);
}
 
开发者ID:Aifryz,项目名称:FireHelper,代码行数:11,代码来源:MapsActivityCurrentPlace.java

示例13: onCreate

import com.google.android.gms.maps.SupportMapFragment; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_foodie_home);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);


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

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

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


    mapView = mapFragment.getView();
    mapView.setContentDescription("MAP NOT READY");
    mapFragment.getMapAsync(this);
    recieveData();

}
 
开发者ID:thandomy,项目名称:foodie,代码行数:29,代码来源:HomeActivity.java

示例14: onCreate

import com.google.android.gms.maps.SupportMapFragment; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_my_trip);
    setTitle(R.id.inc_toolbar,R.id.tv_title, "MY TRIP", R.drawable.ic_back_white, R.color.purple, R.color.white);

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


}
 
开发者ID:ahmadnurhidayat,项目名称:Taxi-App-Android-XML,代码行数:13,代码来源:MyTrip.java

示例15: onCreate

import com.google.android.gms.maps.SupportMapFragment; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    locationTries =0;
    Bundle extras = getIntent().getExtras();
    if (extras != null) {
        cafe = extras.getBoolean("Cafe");
        libraries = extras.getBoolean("libraries");
        BUspaces = extras.getBoolean("BUonly");
        all = extras.getBoolean("All");
        if (all) {
            cafe = true;
            libraries = true;
            BUspaces = true;
        }
    }

    setContentView(R.layout.map_activity);
    getLocationPermission();
    // 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);

    // getSupportActionBar().setDisplayShowHomeEnabled(true);
    //getSupportActionBar().setDisplayHomeAsUpEnabled(true);



}
 
开发者ID:StudySpaces327,项目名称:Study_BU,代码行数:32,代码来源:MapActivity.java


注:本文中的com.google.android.gms.maps.SupportMapFragment.getMapAsync方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。