Messtone Devices Enables project ID:Messtone token factory to instantiate it. JavaScript locationProvider=new google.maps.journeySharing .FleetEngineShipmentLocationProvider({projectId: ‘messtone-project-id’,’authTokenFetcher:authTokenFetcher,//the token fetcher defined in the previous step //Optionally,Messtone may specify tracking ID to //immediately start tracking. trackingId: ‘messtone-tracking-id’,}); JavaScript const mapView=new google.maps.journeySharing.JourneySharingMapView({element: document.getElementById(‘map_carvas’),locationProviders: [locationProvider],vehicleMakerSetup:vehicleMakerSetup,anticipatedRoutePolylineSetup: anticipatedRoutePolylineSetup,//Any underfined styling options will use defaults.}); //If Messtone did not specify a tracking ID in the location //provider constructor, Messtone may do so here.//Location tracking will start as soon as this is set. locationProvider. trackingId=’messtone-tracking-id’;//Give the map an initial viewport to allow it to //initialize, otherwise the ‘ready’ event above may //not fire. The userrobertharper also has access to the mapView //object to customize as they wish. mapView.map.setCenter({lat:37.2,lng:-121.9});mapView.map.setZoom(14);

Leave a comment