本文整理了Java中com.google.android.gms.maps.SupportMapFragment.getMap()
方法的一些代码示例,展示了SupportMapFragment.getMap()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SupportMapFragment.getMap()
方法的具体详情如下:
包路径:com.google.android.gms.maps.SupportMapFragment
类名称:SupportMapFragment
方法名:getMap
暂无
代码示例来源:origin: CUTR-at-USF/OpenTripPlanner-for-Android
/**
* Retrieves a map if the map fragment parameter is null.
* <p>
* If there is an error tries to solve it checking if it was because of
* "Google Play Services" sending the corresponding intent.
*
* @param mMap map fragment to check if the map is already initialized
* @return initialized map fragment
*/
private GoogleMap retrieveMap(GoogleMap mMap) {
// Do a null check to confirm that we have not already instantiated the map.
mMapFailed = false;
if (mMap == null) {
mMap = ((SupportMapFragment) getChildFragmentManager().findFragmentById(R.id.map))
.getMap();
// Check if we were successful in obtaining the map.
if (mMap == null) {
int status = GooglePlayServicesUtil
.isGooglePlayServicesAvailable(mApplicationContext);
if (status != ConnectionResult.SUCCESS) {
enableUIElements(false);
Dialog dialog = GooglePlayServicesUtil.getErrorDialog(status, getActivity(),
OTPApp.CHECK_GOOGLE_PLAY_REQUEST_CODE);
dialog.show();
mMapFailed = true;
}
}
}
return mMap;
}
代码示例来源:origin: GeoODK/collect
.findFragmentById(R.id.map)).getMap();
mMap.setOnMarkerDragListener(this);
代码示例来源:origin: CUTR-at-USF/OpenTripPlanner-for-Android
LatLngBounds routeBounds = boundsCreator.build();
if (((SupportMapFragment) getChildFragmentManager().findFragmentById(R.id.map))
.getMap()
!= null){
showRouteOnMapAnimateCamera(routeBounds, firstTransitMarker, animateCamera);
代码示例来源:origin: CUTR-at-USF/OpenTripPlanner-for-Android
@Override
public void onStart() {
super.onStart();
mGoogleApiClient = new GoogleApiClient.Builder(getActivity())
.addApi(API)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.build();
if (mMapFailed) {
mMap = ((SupportMapFragment) getChildFragmentManager().findFragmentById(R.id.map))
.getMap();
// Check if we were successful in obtaining the map.
if (mMap != null) {
enableUIElements(true);
initializeMapInterface(mMap);
runAutoDetectServerNoLocation(true);
}
}
connectLocationClient();
}
代码示例来源:origin: SkyTreasure/Airbnb-Android-Google-Map-View
getSupportFragmentManager().beginTransaction().replace(R.id.map, mapFragment).commit();
map = mapFragment.getMap();
代码示例来源:origin: thorbenprimke/realm-mapview
@SuppressWarnings("unchecked")
private void setUpMapIfNeeded() {
if (map != null) {
return;
}
Fragment fragment = getChildFragmentManager().findFragmentById(R.id.support_map_fragment);
if (fragment == null) {
throw new IllegalStateException("Map fragment not found.");
}
map = ((SupportMapFragment) fragment).getMap();
if (map == null) {
throw new IllegalStateException("Map not found in fragment.");
}
getMap().moveCamera(CameraUpdateFactory.newLatLngZoom(
new LatLng(getDefaultLatitude(), getDefaultLongitude()),
getDefaultZoom()));
RealmClusterManager<M> realmClusterManager =
new RealmClusterManager<>(getActivity(), getMap());
RealmResults<M> realmResults = realm.where(clazz).findAll();
realmClusterManager.updateRealmResults(
realmResults,
getTitleColumnName(),
getLatitudeColumnName(),
getLongitudeColumnName());
realmClusterManager.setRenderer(
new RealmClusterRenderer(getActivity(), getMap(), realmClusterManager));
getMap().setOnCameraChangeListener(realmClusterManager);
getMap().setOnMarkerClickListener(realmClusterManager);
getMap().setOnInfoWindowClickListener(realmClusterManager);
}
内容来源于网络,如有侵权,请联系作者删除!