本文整理汇总了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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}