Package com.mapfactor.sdk.map
Class MapFragment
java.lang.Object
SdkFragment
com.mapfactor.sdk.map.MapFragment
public class MapFragment
extends SdkFragment
Map fragment. Use directly or via MapView.
- Since:
- 1.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Head-up navigation display mode typesstatic enum
Map modesstatic enum
setMapMode method result -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addOnMapReadyListener
(MapReadyListener listener) Add MapReadyListenerGet current Head-up modeGet Map controls modulevoid
setCenter
(Coordinate center) Center map to given coordinate.void
Set Head-up display mode during navigationsetMapMode
(MapFragment.MapMode mapMode) Change map modevoid
setNightMode
(boolean nightModeOn) Enable/disable night modeboolean
showMessage
(String message) Show a messagevoid
showOnMap
(NavigationHistoryRoute navigationHistoryRoute, int routeColor, int lineWidth) Show navigation history route on mapvoid
showOnMap
(SearchResult searchResult) Show search result on map
-
Constructor Details
-
MapFragment
public MapFragment()
-
-
Method Details
-
addOnMapReadyListener
Add MapReadyListener- Parameters:
listener
- map ready listener- Since:
- 1.0
-
setCenter
Center map to given coordinate. This turns off map centering to current GPS position.- Parameters:
center
- coordinate to set map center to- Since:
- 3.11
-
setMapMode
Change map mode- Parameters:
mapMode
- new map mode- Returns:
- success/failure
- Since:
- 1.0
-
setNightMode
public void setNightMode(boolean nightModeOn) Enable/disable night mode- Parameters:
nightModeOn
- true/false to enable/disable night mode- Since:
- 1.0
-
setHUDMode
Set Head-up display mode during navigation- Parameters:
mode
- head-up mode to set- Since:
- 2.2
-
getHUDMode
Get current Head-up mode- Returns:
- current Head-up mode
- Since:
- 2.2
-
getMapControls
Get Map controls module- Returns:
- Map controls instance
- Since:
- 1.0
-
showOnMap
Show search result on map- Parameters:
searchResult
- result from Search engine to show on map- Since:
- 1.0
-
showMessage
Show a message- Parameters:
message
- text to show- Returns:
- success/failure (may fail when the fragment is npt attached to an activity)
- Since:
- 1.0
-