Module Veery
getLocationHistory(format, since, until, callback)
Get the historical geolocation data for the mentioned period.
The format parameter defines the type of historical data the set returned will be filled with : RAW or ROUTEMATCH.
Parameters
Param name | Type | Possible Values / Usage |
---|---|---|
format | int | Veery.HISTORY_RAW : Will return the strictly the data collected |
Veery.HISTORY_ROUTEMATCH : Will return an enhanced version of the data collected representing the estimated trips that the Veery BACKEND or the Veery GEOPROFILE algorithms have deducted from the data. Using the GEOPROFILE activate mode, the trips is computed considering similar days and trips as well as traffic jams and train timetables to compensate the absence of geolocation data during the trips. | ||
since | Date | Represent the time of the beginning of the historical period required. |
null could be used for "since the beginning" | ||
until | Date | Represent the time of the end of the historical period required. |
null could be used for "until the end" | ||
callback | function | return the Veery.Locations object |
### Returns |
Veery.Locations object
Usage / Example
import React, { Component } from 'react'; import {Platform,StyleSheet,Text,Button,View} from 'react-native'; import Veery from 'react-native-veery'; export default class App extends Component<{}> { componentWillMount(){ Veery.serviceConnect(); Veery.setApiKeySecret('SuPeRScrET12345789GhJ'); // Veery.activate(Veery.GEOPROFILE); // Requires react-native-veery 1.4.4 or higher // Veery.activate(Veery.BACKGROUND_GEOLOC | Veery.COLLECT | Veery.ROUTE_MATCH ); } getlocationhistory(){ Veery.requestRouteMatch(); Veery.getLocationHistory(Veery.HISTORY_RAW,1510876800000,new Date().getTime(), (locations) => { if (locations !== null) { console.log('locations App.js---toArray.count------',locations.toArray().length); console.log('locations App.js---toArray------',locations.toArray()); console.log('locations App.js---toGeoJSON------',locations.toGeoJSON(Veery.GEOJSON_MULTIPOINT)); console.log('locations App.js---getBoundingBox------',locations.getBoundingBox()); } }) } render() { return( <View > <Text > Welcome to VeeryDemoReactNative!</Text> <Button onPress = {this.getlocationhistory} title="Location History" color="#8FFF04"/> </View> );} }
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.