當前位置: 首頁>>代碼示例>>Java>>正文


Java MapFragment.getMapAsync方法代碼示例

本文整理匯總了Java中com.google.android.gms.maps.MapFragment.getMapAsync方法的典型用法代碼示例。如果您正苦於以下問題:Java MapFragment.getMapAsync方法的具體用法?Java MapFragment.getMapAsync怎麽用?Java MapFragment.getMapAsync使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.android.gms.maps.MapFragment的用法示例。


在下文中一共展示了MapFragment.getMapAsync方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onCreate

import com.google.android.gms.maps.MapFragment; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this);
    String themes = sharedPrefs.getString(
            getString(R.string.settings_themes_key),
            getString(R.string.settings_themes_default));
    switch (themes) {
        case "dark":
            setTheme(R.style.AppTheme);
            break;
        case "light":
            setTheme(R.style.AppTheme_Light);
    }
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_maps);
    LoaderManager loaderManager = getLoaderManager();
    loaderManager.initLoader(0, null, this);
    MapFragment mapFragment = (MapFragment) getFragmentManager().findFragmentById(R.id.map);
    mapFragment.getMapAsync(this);

}
 
開發者ID:rahul051296,項目名稱:quake-alert-android-app,代碼行數:22,代碼來源:MapsActivity.java

示例2: initializeViewElements

import com.google.android.gms.maps.MapFragment; //導入方法依賴的package包/類
private void initializeViewElements() {
    name = (TextView) findViewById(R.id.place_name);
    address = (TextView) findViewById(R.id.place_address);

    editButton = (Button) findViewById(R.id.place_edit_button);
    deleteButton = (Button) findViewById(R.id.place_delete_button);

    back = (ImageButton) findViewById(R.id.place_back_button);
    MapFragment mapFragment = (MapFragment) getFragmentManager().findFragmentById(R.id.map);

    fancifyNameAndAddress();
    editButtonListener();
    deleteButtonListener();
    backButtonListener();
    mapFragment.getMapAsync(this);
}
 
開發者ID:mobility-profile,項目名稱:Mobility-Profile,代碼行數:17,代碼來源:YourPlaceActivity.java

示例3: onCreate

import com.google.android.gms.maps.MapFragment; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);


    dwarka = new MarkerOptions()
             .position(new LatLng(28.5921,77.0460))
             .title("Dwarka");

    rohini = new MarkerOptions()
             .position(new LatLng(28.7495,77.0565))
             .title("Rohini");

    cp = new MarkerOptions()
             .position(new LatLng(28.6315, 77.2167))
             .title("Cp");

    lajpatnagar = new MarkerOptions()
                  .position(new LatLng(28.5677,77.2433))
                  .title("Lajpat Nagar");

    MapFragment mapFragment = (MapFragment)getFragmentManager().findFragmentById(R.id.map);
    mapFragment.getMapAsync(this);
}
 
開發者ID:NikhilBhutani,項目名稱:Android-Snippets,代碼行數:26,代碼來源:MainActivity.java

示例4: onViewCreated

import com.google.android.gms.maps.MapFragment; //導入方法依賴的package包/類
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);

    MapFragment fragment = (MapFragment) getChildFragmentManager().findFragmentById(R.id.map);
    fragment.getMapAsync(this);

    locationManager = (LocationManager) getActivity().getSystemService(LOCATION_SERVICE);
    if(PermissionCheck.checkPermission(getActivity())){
        locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,0,0,this);
        mLastLocation = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);
    }
    markerController =  new MarkerController();
    pendingIntentController = new PendingIntentController();
    itemController = new ItemController();
    questController = new QuestController();

    database_functions = Database_Functions.getInstance(getActivity(),getActivity());
    user = database_functions.getUserData();
}
 
開發者ID:TransCoders,項目名稱:The_Elucidated,代碼行數:21,代碼來源:GMapFragment.java

示例5: onCreateView

import com.google.android.gms.maps.MapFragment; //導入方法依賴的package包/類
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {

    mapView  = inflater.inflate(R.layout.fragment_playback_overview, container, false);

    MapFragment mapFragment =
            (MapFragment) getChildFragmentManager().findFragmentById(R.id.map_overview);

    if ( mapFragment != null ){
        mapFragment.getMapAsync(this);
    } else {
        Log.e(TAG, "MapFragment not found!");
    }

    return mapView;
}
 
開發者ID:ehigham,項目名稱:RideOut,代碼行數:18,代碼來源:PolylineFragment.java

示例6: onCreateView

import com.google.android.gms.maps.MapFragment; //導入方法依賴的package包/類
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    mapView  = inflater.inflate(R.layout.fragment_playback_overview, container, false);

    MapFragment mapFragment =
            (MapFragment) getChildFragmentManager().findFragmentById(R.id.map_overview);

    if ( mapFragment != null ){
        mapFragment.getMapAsync(this);
    } else {
        Log.e(TAG, "MapFragment not found!");
    }

    return mapView;
}
 
開發者ID:ehigham,項目名稱:RideOut,代碼行數:17,代碼來源:PlaybackOverviewFragment.java

示例7: onCreate

import com.google.android.gms.maps.MapFragment; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_observation_form_picker);

    RecyclerView recyclerView = (RecyclerView) findViewById(R.id.forms);

    FlexboxLayoutManager layoutManager = new FlexboxLayoutManager(this);
    layoutManager.setFlexDirection(FlexDirection.ROW);
    layoutManager.setJustifyContent(JustifyContent.CENTER);
    recyclerView.setLayoutManager(layoutManager);

    JsonArray formDefinitions = EventHelper.getInstance(getApplicationContext()).getCurrentEvent().getForms();
    Adapter adapter = new Adapter(this, formDefinitions);
    recyclerView.setAdapter(adapter);

    findViewById(R.id.close).setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            cancel(v);
        }
    });

    MapFragment mapFragment = (MapFragment) getFragmentManager().findFragmentById(R.id.map);
    mapFragment.getMapAsync(this);
}
 
開發者ID:ngageoint,項目名稱:mage-android,代碼行數:27,代碼來源:ObservationFormPickerActivity.java

示例8: onCreate

import com.google.android.gms.maps.MapFragment; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_place_maps);

    // Initialize variables
    transition = (TextView) findViewById(R.id.destination);
    time = (TextView) findViewById(R.id.time);
    distance = (TextView) findViewById(R.id.distance);
    progressBar = (ProgressBar) findViewById(R.id.progress_path);

    // Get data from previous activity
    Intent intent = getIntent();
    Lati = Double.parseDouble(intent.getStringExtra(HangoutsTypeDisplay.HangoutTypeAdapter.INTENT_LATI));
    Longi = Double.parseDouble(intent.getStringExtra(HangoutsTypeDisplay.HangoutTypeAdapter.INTENT_LONG));
    place_name = intent.getStringExtra(HangoutsTypeDisplay.HangoutTypeAdapter.INTENT_PLACE_NAME);
    place_id = intent.getStringExtra(HangoutsTypeDisplay.HangoutTypeAdapter.INTENT_PLACE_ID);

    mHandler = new Handler(Looper.getMainLooper());
    transition.setText("Current Location To " + place_name);

    // Initialize map
    MapFragment mapFragment = (MapFragment) getFragmentManager().findFragmentById(R.id.place_map);
    mapFragment.getMapAsync(this);
}
 
開發者ID:Swati4star,項目名稱:NSIT-Connect,代碼行數:27,代碼來源:PlaceMapActivity.java

示例9: onCreate

import com.google.android.gms.maps.MapFragment; //導入方法依賴的package包/類
public void onCreate(Bundle savedState) {
    super.onCreate(savedState);

    // Set the layout. It only contains a SupportMapFragment and a DismissOverlay.
    setContentView(R.layout.activity_map);

    // Obtain the Attraction that we need to display.
    mAttraction = getIntent().getParcelableExtra(Constants.EXTRA_ATTRACTION);

    // Obtain the DismissOverlayView and display the intro help text.
    mDismissOverlay = (DismissOverlayView) findViewById(R.id.map_dismiss_overlay);
    mDismissOverlay.setIntroText(R.string.exit_intro_text);
    mDismissOverlay.showIntroIfNecessary();

    // Obtain the MapFragment and set the async listener to be notified when the map is ready.
    MapFragment mapFragment = (MapFragment) getFragmentManager()
                    .findFragmentById(R.id.map);
    mapFragment.getMapAsync(this);
}
 
開發者ID:googlesamples,項目名稱:io2015-codelabs,代碼行數:20,代碼來源:MapActivity.java

示例10: showMap

import com.google.android.gms.maps.MapFragment; //導入方法依賴的package包/類
private void showMap()
{
	if(mPharmacyAddressesSize == 0)
	{
		mTools.showToast(getString(R.string.pharmacies_location_map_location_not_found), 1);

		finish();
	}
	else
	{
		mTools.showToast(getString(R.string.pharmacies_location_map_locating), 0);

		MapFragment mapFragment = (MapFragment) getFragmentManager().findFragmentById(R.id.pharmacies_location_map_map);
		mapFragment.getMapAsync(this);
	}
}
 
開發者ID:olejon,項目名稱:mdapp,代碼行數:17,代碼來源:PharmaciesLocationMapActivity.java

示例11: onCreate

import com.google.android.gms.maps.MapFragment; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.mapartist);
    MapFragment mf = (MapFragment) getFragmentManager().findFragmentById(R.id.map);
    mf.getMapAsync(this);
    geocoder = new Geocoder(this);
    Intent myCallerIntentHandler = getIntent();
    Bundle myBundle = myCallerIntentHandler.getExtras();

    paramArray = myBundle.getIntegerArrayList("myIntArray1");
    artistList = (ArrayList<artist>) myBundle.getSerializable("artists");

    latlongCheck(paramArray,artistList);

    retrieveCities(paramArray,artistList);
}
 
開發者ID:rootulp,項目名稱:school,代碼行數:18,代碼來源:MapsActivity.java

示例12: onCreate

import com.google.android.gms.maps.MapFragment; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_maps);
    // Find view elements
    progressSpinner = this.findViewById(R.id.progressSpinner);
    progressSpinner.setVisibility(ProgressBar.GONE);

    // Initialize map
    final MapFragment mapFragment = (MapFragment) getFragmentManager().findFragmentById(R.id.map);
    mapFragment.getMapAsync(this);

    // Save this instance to a static variable to make it possible to refresh map
    MapsActivity.instance = this;

    // Initialize Services in the background
    ASR.init(getApplicationContext());
}
 
開發者ID:platypii,項目名稱:AntennaMap,代碼行數:19,代碼來源:MapsActivity.java

示例13: fillMap

import com.google.android.gms.maps.MapFragment; //導入方法依賴的package包/類
private void fillMap(){
    final MapFragment mapFragment = (MapFragment) getFragmentManager().findFragmentById(R.id.map);
    mapFragment.getMapAsync(new OnMapReadyCallback() {
        @Override
        public void onMapReady(GoogleMap googleMap) {
            map = googleMap;
            map.setMyLocationEnabled(false);
            map.getUiSettings().setTiltGesturesEnabled(false);
            map.getUiSettings().setMyLocationButtonEnabled(false);
            map.getUiSettings().setMapToolbarEnabled(false);
            map.clear();
            boolean first = true;
            PolylineOptions line = new PolylineOptions();
            map.addPolyline(line);
            for (ChronicleEvent event : bartour.getChronicle().getChronicleEvents(LocationChronicleEvent.class)) {
                LocationChronicleEvent locationEvent = (LocationChronicleEvent) event;
                if (first) {
                    first = false;
                    map.animateCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(locationEvent.getLatitude(), locationEvent.getLongitude()), 15));
                }
                MarkerOptions marker = new MarkerOptions();
                LatLng latLng = new LatLng(locationEvent.getLatitude(), locationEvent.getLongitude());
                marker.title(locationEvent.getLocationName().toString())
                        .position(latLng);
                if (locationEvent instanceof ATMLocationChronicleEvent) {
                    marker.icon(BitmapDescriptorFactory.fromResource(R.drawable.ic_money_pin));
                } else {
                    marker.icon(BitmapDescriptorFactory.fromResource(R.drawable.ic_action_beer_pin));
                }
                map.addMarker(marker);
                line.add(latLng);
            }
            map.addPolyline(line);

        }
    });
}
 
開發者ID:Bartout-Team,項目名稱:Bartout,代碼行數:38,代碼來源:ChronicleActivity.java

示例14: onCreate

import com.google.android.gms.maps.MapFragment; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_map);

    MapFragment mapFragment= (MapFragment) getFragmentManager().findFragmentById(R.id.map);
    mapFragment.getMapAsync(this);

}
 
開發者ID:appteam-nith,項目名稱:Nimbus,代碼行數:10,代碼來源:MapActivity.java

示例15: onCreate

import com.google.android.gms.maps.MapFragment; //導入方法依賴的package包/類
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    MapFragment mapFragment = (MapFragment) getFragmentManager()
            .findFragmentById(R.id.map);
    mapFragment.getMapAsync(this);
}
 
開發者ID:Pavou,項目名稱:Stalker,代碼行數:9,代碼來源:MyMapFragment.java


注:本文中的com.google.android.gms.maps.MapFragment.getMapAsync方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。