public class HyperTrackMap extends Object
bind(LocationProvider)
GpsLocationProvider
Modifier and Type | Field and Description |
---|---|
static String |
GPS_LOCATION_PROVIDER |
static int |
LOCATION_MAP_OBJECT_TYPE |
static int |
TRIP_MAP_OBJECT_TYPE |
static String |
VIEWS_LOCATION_PROVIDER |
Modifier and Type | Method and Description |
---|---|
MapAdapter |
adapter()
Getter for HyperTrackMap adapter.
|
HyperTrackMap |
bind(HyperTrackViews hyperTrackViews,
String deviceId)
Binds
HyperTrackViews instance with device to HyperTrackMap. |
HyperTrackMap |
bind(LocationProvider locationProvider)
Binds
LocationProvider implementation to HyperTrackMap. |
void |
destroy()
Destroys the HyperTrackMap and all inner data.
|
static HyperTrackMap |
getInstance(android.content.Context context,
MapAdapter mapAdapter)
Creates new instance of HyperTrackMap from
Context and MapAdapter . |
void |
moveToLocation(double latitude,
double longitude)
Moves the camera from the current position to the position of coordinates.
|
void |
moveToMyLocation()
Moves the camera from the current position to the last known position.
|
void |
moveToTrip(Trip trip)
Moves the camera from the current position to object's coordinates defined in the trip,
by combining trip objects that transforms the camera such that the
specified latitude/longitude bounds are centered on screen at the greatest possible zoom level.
|
void |
setLocationUpdatesListener(android.location.LocationListener locationListener)
Register a callback for location updates.
|
void |
setMyLocationEnabled(boolean enabled)
Enables and disables displaying and updating of my location.
|
TripSubscription |
subscribeTrip(String tripId)
Subscribes real-time trip updates to map.
|
HyperTrackMap |
unbindHyperTrackViews()
Unbinds
HyperTrackViews instance from HyperTrackMap. |
public static final String GPS_LOCATION_PROVIDER
public static final String VIEWS_LOCATION_PROVIDER
public static final int LOCATION_MAP_OBJECT_TYPE
public static final int TRIP_MAP_OBJECT_TYPE
public static HyperTrackMap getInstance(android.content.Context context, MapAdapter mapAdapter)
Context
and MapAdapter
.context
- reference to ContextmapAdapter
- MapAdapter implementation.public MapAdapter adapter()
public HyperTrackMap bind(HyperTrackViews hyperTrackViews, String deviceId)
HyperTrackViews
instance with device to HyperTrackMap. After that you will receive
location and trips updates from HyperTrack which will be displays in real-time on the map.hyperTrackViews
- HyperTrackViews
instance.deviceId
- HyperTrack device id (HyperTrack.getInstance(context, "HYPER_TRACK_PUB_KEY").getDeviceID())public HyperTrackMap unbindHyperTrackViews()
HyperTrackViews
instance from HyperTrackMap. After that you will receive
location from the device which will be displays in real-time on the map.public HyperTrackMap bind(LocationProvider locationProvider)
LocationProvider
implementation to HyperTrackMap.locationProvider
- location provider that updates my location on map.public void setLocationUpdatesListener(android.location.LocationListener locationListener)
locationListener
- a LocationListener
whose
LocationListener.onLocationChanged(android.location.Location)
method
will be called for each location update. This value may be null.public void setMyLocationEnabled(boolean enabled)
enabled
- true if should be enabled, false otherwise.public void moveToMyLocation()
public void moveToLocation(double latitude, double longitude)
latitude
- coordinate of new camera position.longitude
- coordinate of new camera position.public void moveToTrip(Trip trip)
trip
- data that includes trip objects with coordinates.public TripSubscription subscribeTrip(String tripId)
tripId
- that should be subscribed.TripSubscription
with which you can unsubscribe.public void destroy()