Class Veery.LocationsHistory

toArray()

Extract an array of Location objects from a history.

  • on Veery.HISTORY_RAW, it returns all geolocation collected
  • on Veery.HISTORY_ROUTEMATCH, it returns successively the start and the end of each trip (StartOfTrip1 at id 1, EndOfTrip1 at id 2, StartOfTrip2 at id 3, ...)

Parameters

none

Returns

[CLLocation]

Usage / Example

    if let locationsHistory = veery.getLocationHistory(Veery.HISTORY_RAW, sinceDate, untilDate){
        let locs = locationsHistory.toArray()
        if locs.count > 0 {
            for loc in locs {
                // do whatever you need with the location object
            }
        }
    }

-

    if let locations = veery.getLocationHistory(Veery.HISTORY_ROUTEMATCH, since, until){
        let locs = locations.toArray()

        if locs > 0 {

            for i in stride(from: 0, to: locs.count, by: 2) {
                let locstart = locs[i]
                let locend   = locs[i+1]
                /////
            }
        }
    }

User interaction

none

See also

getLocationHistory

Get the historical geolocation data for the mentioned period.

requestRouteMatch

Request Veery to be warned when a new trip was computed by the backend.

stopRouteMatch

Cancel the call to requestRouteMatch.

Locations.toArray

Extract an array of Location objects from a history.

Locations.toGeoJSON

Get a GeoJson representing the history collected. Get a GeoJson representing the history collected.

Locations.toGeoJSONArray

Get an array of GeoJson representing the history collected. Only valid for Veery.HISTORY_ROUTEMATCH.

Locations.getBoundingBox

Get the bounding box of the set of historical data.

veeryRouteMatch

Delegate triggered when the backend computed new trips.