Module Veery
requestRouteMatch()
Request Veery to be warned when a new trip was computed by the backend.
This could be used to refresh a Maps.
Parameters
none
Retrns
Void
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.ROUTE_MATCH ); Veery.requestRouteMatch(); // You can requestRouteMatch here } getlocationhistory(){ Veery.requestRouteMatch(); // Or You can requestRouteMatch here or when you need it Veery.getLocationHistory(Veery.HISTORY_ROUTEMATCH,1510876800000,new Date().getTime(), (locations) => { if (locations !== null) { console.log('locations App.js---toArray------',locations.toArray()); console.log('locations App.js---toGeoJSONArray.count------',locations.toGeoJSONArray().length); console.log('locations App.js---toGeoJSONArray------',locations.toGeoJSONArray()); 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.