Class Veery.Locations

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

[Locations]

Usage / Example

    Veery.getLocationHistory(Veery.HISTORY_RAW,1510876800000,new Date().getTime(),
    (locations) => {
        if (locations !== null) {

            let locs = locations.toArray();
            console.log('locations App.js---toArray------',locs.length);
            for (var i = 0; i < locs.length; i++) {

                    console.log('location ------'+i+'----','longitude: '+locs[i].longitude+'   latitude: '+locs[i].latitude);

            }
        }
    })

-

    Veery.getLocationHistory(Veery.HISTORY_ROUTEMATCH,1510876800000,new Date().getTime(),
    (locations) => {

        if (locations !== null) {
                let locs = locations.toArray();
                console.log('locations ---toArray------',locs.length);
                for (var i = 0; i < locs.length; i+=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

Callback triggered when the backend computed new trips.