public class Map
extends java.lang.Object
implements com.mapbox.mapboxsdk.maps.OnMapReadyCallback
Modifier and Type | Class and Description |
---|---|
static class |
Map.AppState
States enum.
|
(package private) static class |
Map.AppTrigger
Triggers enum.
|
(package private) class |
Map.IdleEntry
Action taken before the state machine enters
Map.AppState.IDLE -> clears the places_
list, nullify and destroy the Mapbox view_ . |
(package private) class |
Map.LoadEntry
Action taken before the state machine enters
Map.AppState.LOADING -> inits the area_
and gets a new Mapbox instance (asynchronously). |
(package private) class |
Map.MarkEntry
Action taken when the state machine enters
Map.AppState.MARKING_ON . |
(package private) class |
Map.MarkExit
Action taken when we're leaving the discovery mode -> removes each marker from map.
|
(package private) class |
Map.StopEntry
Action taken when the state machine enters
Map.AppState.STOPPED -> Place.stop()
every places_ and sets tracked_ to false . |
(package private) class |
Map.TrackEntry
Action taken when the state machine enters
Map.AppState.TRACKING_ON . |
(package private) class |
Map.TrackExit
|
Modifier and Type | Field and Description |
---|---|
private Place |
active_place_
A reference to the last
Place being touched. |
private Area |
area_
The soundscape area.
|
private com.mapbox.androidsdk.plugins.building.BuildingPlugin |
building_plugin_
BuildingPlugin implementation. |
private android.content.Context |
context_ |
private com.github.oxo42.stateless4j.StateMachine<Map.AppState,Map.AppTrigger> |
fsm_
The state machine.
|
private boolean |
map_ready_
Indicates that the map is ready.
|
private boolean |
marked_
Keeps track of
Map.AppState.RUNNING sub-states. |
private java.util.ArrayList<Place> |
places_
An array containing every
Place s. |
private boolean |
tracked_ |
private com.mapbox.mapboxsdk.maps.MapView |
view_
MainActivity 's map view. |
Constructor and Description |
---|
Map(android.content.Context context,
com.mapbox.mapboxsdk.maps.MapView view)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Place |
active_place() |
void |
destroy()
destroy() trigger. |
void |
frame_places() |
void |
mark(boolean value)
mark(boolean) trigger. |
boolean |
marked() |
void |
onMapReady(com.mapbox.mapboxsdk.maps.MapboxMap mapboxMap)
OnMapReadyCallback implementation. |
private Place |
place_from_entity_(PlaceEntity place_entity)
|
private Place |
place_from_marker_(com.mapbox.mapboxsdk.annotations.Marker marker)
Finds the corresponding
Place a Marker is associated to by comparing locations. |
boolean |
ready() |
private void |
remove_markers() |
void |
resume()
Resume trigger.
|
void |
set_active_place(PlaceEntity place_entity)
Sets the current active place.
|
Map.AppState |
state() |
void |
stop()
stop() trigger. |
void |
track(boolean value) |
boolean |
tracked() |
private final android.content.Context context_
private final com.mapbox.mapboxsdk.maps.MapView view_
MainActivity
's map view.private final com.github.oxo42.stateless4j.StateMachine<Map.AppState,Map.AppTrigger> fsm_
@Nullable private Area area_
private boolean map_ready_
private boolean marked_
Map.AppState.RUNNING
sub-states.private boolean tracked_
private com.mapbox.androidsdk.plugins.building.BuildingPlugin building_plugin_
BuildingPlugin
implementation.public Map(@NonNull android.content.Context context, @NonNull com.mapbox.mapboxsdk.maps.MapView view)
context
- Application Context
view
- Mapbox MapView
public void onMapReady(com.mapbox.mapboxsdk.maps.MapboxMap mapboxMap)
OnMapReadyCallback
implementation.onMapReady
in interface com.mapbox.mapboxsdk.maps.OnMapReadyCallback
@Nullable private Place place_from_marker_(com.mapbox.mapboxsdk.annotations.Marker marker)
Place
a Marker
is associated to by comparing locations.marker
- The markerpublic void set_active_place(@NonNull PlaceEntity place_entity)
place_entity
- The new entity@Nullable private Place place_from_entity_(PlaceEntity place_entity)
place_entity
- A PlaceEntity
as found by the Place.entity()
method.places_
.public void frame_places()
public void track(boolean value)
public void mark(boolean value)
mark(boolean)
trigger.public void stop()
stop()
trigger.private void remove_markers()
public void destroy()
destroy()
trigger.public void resume()
public boolean ready()
public boolean tracked()
public boolean marked()
@Nullable public Place active_place()
public Map.AppState state()