Code example for MapFragment

Methods: getMap

0
 
	public void initMapIfNeeded() { 
		if (_googleMap == null) {
			// 2 cases now. It's either google play service is unavailable or not really initialized 
 
			_googleMap = _mapFragment.getMap();
			if (_googleMap == null) {
				// google play service is not available on user's device, we simply return. 
				// activity will call this method in onResume() 
				return; 
				// then MapFragment will show a label and a button directing user to download google play service 
			} 
 
			try { 
				MapsInitializer.initialize(_mapFragment.getActivity());
			} catch (GooglePlayServicesNotAvailableException e) {
				Log.e(GoogleMapManager.class.getSimpleName(), e.toString());
				return; 
			} 
 
			_uiManager = new UiManager();