-
- All Implemented Interfaces:
-
android.arch.lifecycle.LifecycleOwner
,android.arch.lifecycle.ViewModelStoreOwner
,android.content.ComponentCallbacks
,android.view.View.OnCreateContextMenuListener
public final class PTRMapFragment extends PTRFragment
Default implementation for PTRMapFragment
Responsible for:
-> Displaying map -> All map interactions (map zoom in/out, scroll) -> Displaying Pois -> Displaying Position -> Displaying Path
The primary component under MapWidget.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public class
PTRMapFragment.Companion
-
Field Summary
Fields Modifier and Type Field Description private PathSession
currentPathSession
private Path
currentPath
private Double
zoomLevel
private Double
minimumZoomLevel
private Double
maximumZoomLevel
private Double
defaultLocationZoomLevel
private final Boolean
isMapFullyRendered
private final Poi
highlightedPoi
private Boolean
isJoystickEnabled
private List<String>
filteredPoiSet
private final Double
rotationalDirection
private final Integer
mState
private final Bundle
mSavedFragmentState
private final SparseArray<Parcelable>
mSavedViewState
private final Boolean
mSavedUserVisibleHint
private final Integer
mIndex
private final String
mWho
private final Bundle
mArguments
private final Fragment
mTarget
private final Integer
mTargetIndex
private final Integer
mTargetRequestCode
private final Boolean
mAdded
private final Boolean
mRemoving
private final Boolean
mFromLayout
private final Boolean
mInLayout
private final Boolean
mRestored
private final Boolean
mPerformedCreateView
private final Integer
mBackStackNesting
private final FragmentManagerImpl
mFragmentManager
private final FragmentHostCallback<Object>
mHost
private final FragmentManagerImpl
mChildFragmentManager
private final FragmentManagerNonConfig
mChildNonConfig
private final ViewModelStore
mViewModelStore
private final Fragment
mParentFragment
private final Integer
mFragmentId
private final Integer
mContainerId
private final String
mTag
private final Boolean
mHidden
private final Boolean
mDetached
private final Boolean
mRetainInstance
private final Boolean
mRetaining
private final Boolean
mHasMenu
private final Boolean
mMenuVisible
private final Boolean
mCalled
private final ViewGroup
mContainer
private final View
mView
private final View
mInnerView
private final Boolean
mDeferStart
private final Boolean
mUserVisibleHint
private final Fragment.AnimationInfo
mAnimationInfo
private final Boolean
mIsNewlyAdded
private final Boolean
mHiddenChanged
private final Float
mPostponedAlpha
private final LayoutInflater
mLayoutInflater
private final Boolean
mIsCreated
private final LifecycleRegistry
mLifecycleRegistry
private final LifecycleRegistry
mViewLifecycleRegistry
private final LifecycleOwner
mViewLifecycleOwner
private final MutableLiveData<LifecycleOwner>
mViewLifecycleOwnerLiveData
-
Constructor Summary
Constructors Constructor Description PTRMapFragment()
-
Method Summary
Modifier and Type Method Description final PathSession
getCurrentPathSession()
final Unit
setCurrentPathSession(PathSession currentPathSession)
final Path
getCurrentPath()
final Unit
setCurrentPath(Path currentPath)
final Double
getZoomLevel()
final Unit
setZoomLevel(Double zoomLevel)
final Double
getMinimumZoomLevel()
final Unit
setMinimumZoomLevel(Double minimumZoomLevel)
final Double
getMaximumZoomLevel()
final Unit
setMaximumZoomLevel(Double maximumZoomLevel)
final Double
getDefaultLocationZoomLevel()
final Unit
setDefaultLocationZoomLevel(Double defaultLocationZoomLevel)
final Boolean
getIsMapFullyRendered()
final Poi
getHighlightedPoi()
final Boolean
getIsJoystickEnabled()
Joystick to simulate user position should be displayed. final Unit
setIsJoystickEnabled(Boolean isJoystickEnabled)
final List<String>
getFilteredPoiSet()
Filters the map to show only the list of given poi ids. final Unit
setFilteredPoiSet(List<String> filteredPoiSet)
final Double
getRotationalDirection()
Unit
onCreate(Bundle savedInstanceState)
View
onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
Unit
onStart()
Unit
onResume()
Unit
onSaveInstanceState(Bundle outState)
Unit
onPause()
Unit
onStop()
Unit
onDestroyView()
Unit
onDestroy()
Unit
onLowMemory()
final Unit
loadAndSet(Level level, Boolean shouldZoomToLevel)
final Unit
loadAndSet(Building building)
When calling this method, the map widget will load the content for this building and related site, if necessary, and displays it. final Unit
loadAndSet(Site site)
When calling this method, the map widget will load the content for this site, if necessary, and displays it. final Unit
setLevel(Level level, Boolean shouldZoomLevel)
Updates map to display given Level final Unit
highlightPoi(Poi poi)
Highlights given Poi final Unit
unhighlightPoi(Poi poi)
Un-highlights given Poi final Unit
unhighlightAllPois()
Unhighlight all Poi final Unit
scrollToLocation(GeoPoint location)
Scroll the map to given location final Unit
scrollToLocation(GeoPoint location, Double zoomLevel)
Scroll the map to given location final Unit
zoomToLocation(GeoPoint location)
Zooms the camera to given location with the default location zoom level. final Unit
setZoomLevel(Double zoomLevel, Boolean isAnimated)
Zooms the camera with desired zoom level. final Unit
rotateToDirection(Double direction, Boolean isAnimated)
Changed the heading of the map and optionally animates the change final Unit
resetNorth()
Resets the map rotation to a northern heading with animation. final Unit
addAnnotation(PTRMapViewMarker ptrMapViewMarker, Level level, PTRMapViewAnnotationLayer ptrMapViewAnnotationLayer)
invoke this method to add an annotation on map final Unit
addAnnotation(PTRMapViewMarker ptrMapViewMarker, PTRMapViewAnnotationLayer ptrMapViewAnnotationLayer)
invoke this method to add an annotation on map final Unit
removeAnnotation(PTRMapViewMarker ptrMapViewMarker)
invoke this method to remove an annotation on map final Unit
removeAllAnnotations()
invoke this method to remove all annotations on map -
Methods inherited from class com.pointrlabs.core.map.views.PTRMapFragment
getColor, hideKeyboard, onActivityCreated, showKeyboard, toast, toast
-
Methods inherited from class com.pointrlabs.core.map.views.helper_views.PTRFragment
callStartTransitionListener, dump, equals, findFragmentByWho, getActivity, getAllowEnterTransitionOverlap, getAllowReturnTransitionOverlap, getAnimatingAway, getAnimator, getArguments, getChildFragmentManager, getContext, getEnterTransition, getEnterTransitionCallback, getExitTransition, getExitTransitionCallback, getFragmentManager, getHost, getId, getLayoutInflater, getLayoutInflater, getLifecycle, getLoaderManager, getNextAnim, getNextTransition, getNextTransitionStyle, getParentFragment, getReenterTransition, getResources, getRetainInstance, getReturnTransition, getSharedElementEnterTransition, getSharedElementReturnTransition, getStateAfterAnimating, getString, getString, getTag, getTargetFragment, getTargetRequestCode, getText, getUserVisibleHint, getView, getViewLifecycleOwner, getViewLifecycleOwnerLiveData, getViewModelStore, hasOptionsMenu, hashCode, initState, instantiateChildFragmentManager, isAdded, isDetached, isHidden, isHideReplaced, isInBackStack, isInLayout, isMenuVisible, isPostponed, isRemoving, isResumed, isStateSaved, isVisible, noteStateNotSaved, onActivityResult, onAttach, onAttach, onAttachFragment, onConfigurationChanged, onContextItemSelected, onCreateAnimation, onCreateAnimator, onCreateContextMenu, onCreateOptionsMenu, onDestroyOptionsMenu, onDetach, onGetLayoutInflater, onHiddenChanged, onInflate, onInflate, onMultiWindowModeChanged, onOptionsItemSelected, onOptionsMenuClosed, onPictureInPictureModeChanged, onPrepareOptionsMenu, onRequestPermissionsResult, onViewCreated, onViewStateRestored, peekChildFragmentManager, performActivityCreated, performConfigurationChanged, performContextItemSelected, performCreate, performCreateOptionsMenu, performCreateView, performDestroy, performDestroyView, performDetach, performGetLayoutInflater, performLowMemory, performMultiWindowModeChanged, performOptionsItemSelected, performOptionsMenuClosed, performPause, performPictureInPictureModeChanged, performPrepareOptionsMenu, performResume, performSaveInstanceState, performStart, performStop, postponeEnterTransition, registerForContextMenu, requestPermissions, requireActivity, requireContext, requireFragmentManager, requireHost, restoreChildFragmentState, restoreViewState, setAllowEnterTransitionOverlap, setAllowReturnTransitionOverlap, setAnimatingAway, setAnimator, setArguments, setEnterSharedElementCallback, setEnterTransition, setExitSharedElementCallback, setExitTransition, setHasOptionsMenu, setHideReplaced, setIndex, setInitialSavedState, setMenuVisibility, setNextAnim, setNextTransition, setOnStartEnterTransitionListener, setReenterTransition, setRetainInstance, setReturnTransition, setSharedElementEnterTransition, setSharedElementReturnTransition, setStateAfterAnimating, setTargetFragment, setUserVisibleHint, shouldShowRequestPermissionRationale, startActivity, startActivity, startActivityForResult, startActivityForResult, startIntentSenderForResult, startPostponedEnterTransition, toString, unregisterForContextMenu
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getCurrentPathSession
final PathSession getCurrentPathSession()
-
setCurrentPathSession
final Unit setCurrentPathSession(PathSession currentPathSession)
-
getCurrentPath
final Path getCurrentPath()
-
setCurrentPath
final Unit setCurrentPath(Path currentPath)
-
getZoomLevel
final Double getZoomLevel()
-
setZoomLevel
final Unit setZoomLevel(Double zoomLevel)
-
getMinimumZoomLevel
final Double getMinimumZoomLevel()
-
setMinimumZoomLevel
final Unit setMinimumZoomLevel(Double minimumZoomLevel)
-
getMaximumZoomLevel
final Double getMaximumZoomLevel()
-
setMaximumZoomLevel
final Unit setMaximumZoomLevel(Double maximumZoomLevel)
-
getDefaultLocationZoomLevel
final Double getDefaultLocationZoomLevel()
-
setDefaultLocationZoomLevel
final Unit setDefaultLocationZoomLevel(Double defaultLocationZoomLevel)
-
getIsMapFullyRendered
final Boolean getIsMapFullyRendered()
-
getHighlightedPoi
final Poi getHighlightedPoi()
-
getIsJoystickEnabled
final Boolean getIsJoystickEnabled()
Joystick to simulate user position should be displayed.
-
setIsJoystickEnabled
final Unit setIsJoystickEnabled(Boolean isJoystickEnabled)
-
getFilteredPoiSet
final List<String> getFilteredPoiSet()
Filters the map to show only the list of given poi ids. Keep in mind that this will be applied to all levels.
-
setFilteredPoiSet
final Unit setFilteredPoiSet(List<String> filteredPoiSet)
-
getRotationalDirection
final Double getRotationalDirection()
-
onCreateView
View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
-
onSaveInstanceState
Unit onSaveInstanceState(Bundle outState)
-
onDestroyView
Unit onDestroyView()
-
onLowMemory
Unit onLowMemory()
-
loadAndSet
final Unit loadAndSet(Level level, Boolean shouldZoomToLevel)
-
loadAndSet
final Unit loadAndSet(Building building)
When calling this method, the map widget will load the content for this building and related site, if necessary, and displays it. By default it displays the first level of the given building.
- Parameters:
building
- to be displayed
-
loadAndSet
final Unit loadAndSet(Site site)
When calling this method, the map widget will load the content for this site, if necessary, and displays it. By default it displays the first level of the first building of the given site.
- Parameters:
site
- to be displayed
-
setLevel
final Unit setLevel(Level level, Boolean shouldZoomLevel)
Updates map to display given Level
- Parameters:
level
- to display on mapshouldZoomLevel
- true if it is desired to zoom to the level
-
highlightPoi
final Unit highlightPoi(Poi poi)
Highlights given Poi
- Parameters:
poi
- to highlight
-
unhighlightPoi
final Unit unhighlightPoi(Poi poi)
Un-highlights given Poi
- Parameters:
poi
- to unhighlight
-
unhighlightAllPois
final Unit unhighlightAllPois()
Unhighlight all Poi
-
scrollToLocation
final Unit scrollToLocation(GeoPoint location)
Scroll the map to given location
- Parameters:
location
- Location to be scrolled on map
-
scrollToLocation
final Unit scrollToLocation(GeoPoint location, Double zoomLevel)
Scroll the map to given location
- Parameters:
location
- Location to be scrolled on mapzoomLevel
- Desired zoom level
-
zoomToLocation
final Unit zoomToLocation(GeoPoint location)
Zooms the camera to given location with the default location zoom level.
- Parameters:
location
- Location to be zoomed upon
-
setZoomLevel
final Unit setZoomLevel(Double zoomLevel, Boolean isAnimated)
Zooms the camera with desired zoom level.
- Parameters:
zoomLevel
- Desired zoom levelisAnimated
- Flag to determine zooming should be animated or not
-
rotateToDirection
final Unit rotateToDirection(Double direction, Boolean isAnimated)
Changed the heading of the map and optionally animates the change
- Parameters:
direction
- The heading of the map, measured in degrees clockwise from true northisAnimated
- Flag to determine changing should be animated or not.
-
resetNorth
final Unit resetNorth()
Resets the map rotation to a northern heading with animation.
-
addAnnotation
final Unit addAnnotation(PTRMapViewMarker ptrMapViewMarker, Level level, PTRMapViewAnnotationLayer ptrMapViewAnnotationLayer)
invoke this method to add an annotation on map
- Parameters:
ptrMapViewMarker
-contains the data for annotation to be added
level
-the level on which the annotation has to be added
ptrMapViewAnnotationLayer
-the layer on which the annotation has to be added
-
addAnnotation
final Unit addAnnotation(PTRMapViewMarker ptrMapViewMarker, PTRMapViewAnnotationLayer ptrMapViewAnnotationLayer)
invoke this method to add an annotation on map
- Parameters:
ptrMapViewMarker
-contains the data for annotation to be added
ptrMapViewAnnotationLayer
-the layer on which the annotation has to be added
-
removeAnnotation
final Unit removeAnnotation(PTRMapViewMarker ptrMapViewMarker)
invoke this method to remove an annotation on map
- Parameters:
ptrMapViewMarker
-contains the data for annotation to be removed
-
removeAllAnnotations
final Unit removeAllAnnotations()
invoke this method to remove all annotations on map
-
-
-
-