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


Java MapView.getMapAsync方法代码示例

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


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

示例1: onCreate

import com.google.android.gms.maps.MapView; //导入方法依赖的package包/类
/**
 * Called on activity start. Generates layout and button functionality.
 * @param savedInstanceState
 */
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_my_habits_map);

    events = (ArrayList<HabitEvent>) getIntent().getSerializableExtra("event list");
    if (events==null || events.size()<1){finish();}


    Toolbar toolbar = (Toolbar) findViewById(R.id.actionbar);
    toolbar.setTitle("Map of My Habit History");
    toolbar.setNavigationIcon(R.drawable.ic_close_button);
    setSupportActionBar(toolbar);

    map = (MapView) findViewById(R.id.myHabitsMap);
    map.onCreate(savedInstanceState);
    map.getMapAsync(this);
}
 
开发者ID:CMPUT301F17T09,项目名称:GoalsAndHabits,代码行数:23,代码来源:MyHabitsMapActivity.java

示例2: onCreateView

import com.google.android.gms.maps.MapView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view =  inflater.inflate(R.layout.fragment_challenge_sender, container, false);

    mapView = (MapView) view.findViewById(R.id.mapView);
    mapView.onCreate(savedInstanceState);
    mapView.getMapAsync(this);

    googleApiClient = ((ChallengeActivity)getActivity()).getGoogleApiClient();
    locationSettingsHandler = ((ChallengeActivity)getActivity()).getLocationSettingsHandler();

    distance = (TextView) view.findViewById(R.id.sender_distance);

    String userName = ((AppRunnest)getActivity().getApplication()).getUser().getName();
    run = new Run(userName);

    return view;
}
 
开发者ID:IrrilevantHappyLlamas,项目名称:Runnest,代码行数:19,代码来源:ChallengeSenderFragment.java

示例3: onCreateView

import com.google.android.gms.maps.MapView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    // Inflate the layout for this fragment
    View view =  inflater.inflate(R.layout.fragment_running_map, container, false);

    // Buttons
    GUISetup(view);

    mapView = (MapView) view.findViewById(R.id.mapView);
    mapView.onCreate(savedInstanceState);
    mapView.getMapAsync(this); //this is important

    // Location
    setupLocation();

    return view;
}
 
开发者ID:IrrilevantHappyLlamas,项目名称:Runnest,代码行数:19,代码来源:RunningMapFragment.java

示例4: onCreateView

import com.google.android.gms.maps.MapView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View v = inflater.inflate(R.layout.fragment_map, container, false);

    mapView = (MapView) v.findViewById(R.id.map);
    mapView.onCreate(savedInstanceState);

    mapView.onResume();// needed to get the googleMap to display immediately

    try {
        MapsInitializer.initialize(getActivity().getApplicationContext());
    } catch (Exception e) {
        e.printStackTrace();
    }

    mapView.getMapAsync(this);

    progressBar = (ProgressBar) v.findViewById(R.id.progressBar);
    emptyListTextView = (TextView) v.findViewById(R.id.emptyListText);

    mapUpdateHandler = new Handler();

    mapUpdater.run();

    return v;
}
 
开发者ID:Gaso-UFS,项目名称:gaso,代码行数:27,代码来源:MapGasoFragment.java

示例5: onCreateView

import com.google.android.gms.maps.MapView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    // Inflate the layout for this fragment
    FrameLayout v = (FrameLayout) inflater.inflate(R.layout.fragment_map, container, false);

    mapView = (MapView) v.findViewById(R.id.map);
    mapView.onCreate(savedInstanceState);
    mapView.onResume();
    mapView.getMapAsync(new OnMapReadyCallback() {
        @Override
        public void onMapReady(GoogleMap googleMap) {
            Log.i("DevMsg", "Success!!!!!");
            myMap = googleMap;
            populateMap();
        }
    });


    return v;
}
 
开发者ID:danthedrummer,项目名称:HuddlOut_client,代码行数:22,代码来源:MapFragment.java

示例6: RestaurantInfoViewHolder

import com.google.android.gms.maps.MapView; //导入方法依赖的package包/类
public RestaurantInfoViewHolder(Context context, View view) {

        super(view);
        mContext = context;
        recommend_msg  = (TextView)view.findViewById(R.id.recommend_restaurant_comment);
        name = (TextView) view.findViewById(R.id.restaurant_name);
        meta = (TextView) view.findViewById(R.id.restaurant_meta);
        addr = (TextView) view.findViewById(R.id.address);
        phoneNum = (TextView)view.findViewById(R.id.phone_number);
        rating = (TextView)view.findViewById(R.id.rating);
        ratingBar = (RatingBar)view.findViewById(R.id.ratingBar);
        mapView = (MapView) view.findViewById(R.id.map);

        recommend_msg.setVisibility(View.GONE);
        meta.setVisibility(View.GONE);

        ratingBar.setStepSize((float)0.5);
        ratingBar.setIsIndicator(false);

        mapView.onCreate(null);
        mapView.getMapAsync(this);
    }
 
开发者ID:mojosoeun,项目名称:Runch,代码行数:23,代码来源:RestaurantInfoViewHolder.java

示例7: setupMap

import com.google.android.gms.maps.MapView; //导入方法依赖的package包/类
protected void setupMap(){
    // GoogleMapOptions to Set Map to Lite Mode
    GoogleMapOptions googleMapOptions = new GoogleMapOptions().liteMode(true);

    mMapView = new MapView(this, googleMapOptions);

    mMapView.setClickable(false);

    mMapView.setLayoutParams(new LinearLayout.LayoutParams(
            ViewGroup.LayoutParams.MATCH_PARENT,
            ViewGroup.LayoutParams.MATCH_PARENT));
    mMapView.setMinimumHeight(MAP_HEIGHT);
    mMapContainer.addView(mMapView);
    mMapContainer.setMinimumHeight(MAP_HEIGHT);

    mMapView.onCreate(null);
    mMapView.onResume();
    mMapView.getMapAsync(this);
}
 
开发者ID:foxtrot94,项目名称:DotHike,代码行数:20,代码来源:ResultsActivity.java

示例8: onCreateView

import com.google.android.gms.maps.MapView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
	final View view = inflater.inflate(R.layout.fragment_report_map, container, false);
	
	mapView = (MapView) view.findViewById(R.id.map);
	mapView.onCreate(savedInstanceState);
       mapView.getMapAsync(this);

       mapOverlaysView = view.findViewById(R.id.mapOverlays);
       ImageButton mapOverlaysButton = (ImageButton) mapOverlaysView
               .findViewById(R.id.mapOverlaysButton);
       mapOverlaysButton.setOnClickListener(new View.OnClickListener() {
           @Override
           public void onClick(View arg0) {
               Intent intent = new Intent(getActivity(), OverlaysActivity.class);
               getActivity().startActivityForResult(intent, ReportCollectionActivity.OVERLAYS_ACTIVITY);
           }
       });

	return view;
}
 
开发者ID:ngageoint,项目名称:disconnected-content-explorer-android,代码行数:22,代码来源:ReportMapFragment.java

示例9: onCreateView

import com.google.android.gms.maps.MapView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    View inflatedView = inflater.inflate(R.layout.fragment_mapa, container, false);

    mMapView = (MapView) inflatedView.findViewById(R.id.mapa);
    mMapView.onCreate(mBundle);

    mMapView.getMapAsync(this);
    return inflatedView;
}
 
开发者ID:nen155,项目名称:TFG-SmartU-La-red-social,代码行数:12,代码来源:FragmentMapa.java

示例10: onCreateView

import com.google.android.gms.maps.MapView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    // Inflate the layout for this fragment
    View inflatedView = inflater.inflate(R.layout.fragment_mapa_proyecto, container, false);

    mMapView = (MapView) inflatedView.findViewById(R.id.mapa_proyecto);
    mMapView.onCreate(mBundle);

    mMapView.getMapAsync(this);
    return inflatedView;
}
 
开发者ID:nen155,项目名称:TFG-SmartU-La-red-social,代码行数:13,代码来源:FragmentMapaProyecto.java

示例11: onCreateView

import com.google.android.gms.maps.MapView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_basic,
            container, false);
    areaTextView = (TextView) view.findViewById(R.id.area);
    lengthTextView = (TextView) view.findViewById(R.id.length);
    mMap = (MapView) view.findViewById(R.id.mapLite);
    mMap.onCreate(savedInstanceState);
    mMap.getMapAsync(this);
    return view;
}
 
开发者ID:bkhezry,项目名称:ExtraMapUtils,代码行数:13,代码来源:BasicFragment.java

示例12: onCreateView

import com.google.android.gms.maps.MapView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.fragment_map, container, false);

    mMapView = (MapView) rootView.findViewById(R.id.mapView);
    mMapView.onCreate(savedInstanceState);

    mMapView.onResume(); // needed to get the map to display immediately

    try {
        MapsInitializer.initialize(getActivity().getApplicationContext());
    } catch (Exception e) {
        e.printStackTrace();
    }

    mMapView.getMapAsync(new OnMapReadyCallback() {
        @Override
        public void onMapReady(GoogleMap mMap) {
            googleMap = mMap;

            // For dropping a marker at a point on the Map
            LatLng sydney = new LatLng(-34, 151);
            googleMap.addMarker(new MarkerOptions().position(sydney).title("Marker Title").snippet("Marker Description"));

            // For zooming automatically to the location of the marker
            CameraPosition cameraPosition = new CameraPosition.Builder().target(sydney).zoom(12).build();
            googleMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));
        }
    });

    return rootView;
}
 
开发者ID:doljko,项目名称:youth-health,代码行数:33,代码来源:MapFragment.java

示例13: PlaceViewHolder

import com.google.android.gms.maps.MapView; //导入方法依赖的package包/类
public PlaceViewHolder(View itemView) {
    super(itemView);

    mContainer = (RelativeLayout) itemView.findViewById(R.id.item_place_container);
    mAlias = (TextView) itemView.findViewById(R.id.item_place_alias);
    mAddress = (TextView) itemView.findViewById(R.id.item_place_address);
    mMapView = (MapView) itemView.findViewById(R.id.item_place_map);
    mMapView.setClickable(false);

    // Initialise the MapView
    mMapView.onCreate(null);
    // Set the map ready callback to receive the GoogleMap object
    mMapView.getMapAsync(this);
}
 
开发者ID:abicelis,项目名称:Remindy,代码行数:15,代码来源:PlaceViewHolder.java

示例14: onCreateView

import com.google.android.gms.maps.MapView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view =  inflater.inflate(R.layout.fragment_challenge_receiver, container, false);

    warningText = (TextView) view.findViewById(R.id.warning_text);
    warningText.setVisibility(View.GONE);
    lastUpdateTime = SystemClock.elapsedRealtime();

    mapView = (MapView) view.findViewById(R.id.mapView);
    mapView.onCreate(savedInstanceState);
    mapView.getMapAsync(this);

    run = new Run(((ChallengeActivity)getActivity()).getOpponentName());
    run.start();

    distance = (TextView) view.findViewById(R.id.receiver_distance);
    updateDisplayedDistance();

    handler = new Handler();
    runnableCode = new Runnable() {
        @Override
        public void run() {
            updateWarningTextVisibility();
            handler.postDelayed(runnableCode, TIME_BEFORE_NOTIFY_MISSING_UPDATES);
        }
    };
    handler.post(runnableCode);

    return view;
}
 
开发者ID:IrrilevantHappyLlamas,项目名称:Runnest,代码行数:31,代码来源:ChallengeReceiverFragment.java

示例15: setupMapUI

import com.google.android.gms.maps.MapView; //导入方法依赖的package包/类
private void setupMapUI(View view, Bundle savedInstanceState) {
    currentMapType = MapType.USER_MAP;
    mapView = (MapView) view.findViewById(R.id.user_map);
    mapView.onCreate(savedInstanceState);
    mapView.getMapAsync(this);

    opponentMapView = (MapView) view.findViewById(R.id.opponent_map);
    opponentMapView.onCreate(savedInstanceState);
}
 
开发者ID:IrrilevantHappyLlamas,项目名称:Runnest,代码行数:10,代码来源:DisplayChallengeFragment.java


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