I am currently using RC3 and have encountered an issue where a variable of an object does not update on the view. This problem arises when retrieving an object from Google, which can take some time.
In previous versions before RC, the view would automatically update once Google returned the result.
Below is the code snippet that I am using to fetch an object from Google. The console displays the data returned by Google, but the view does not reflect this change.
var service = new google.maps.DistanceMatrixService;
service.getDistanceMatrix({
origins: [p1],
destinations: [p2],
travelMode: google.maps.TravelMode.DRIVING,
unitSystem: google.maps.UnitSystem.METRIC,
avoidHighways: false,
avoidTolls: false
}, function(response, status) {
if (status !== google.maps.DistanceMatrixStatus.OK) {
alert('Error: ' + status);
let googDist = google.maps.geometry.spherical.computeDistanceBetween(p1, p2);
return Math.round(googDist / 1000 *10)/10;
} else {
//console.log(response.rows[0].elements[0].distance.text);
this.car.drivingDistance = response.rows[0].elements[0].distance.text;
}
});
console.log(this.car.drivingDistance);
While the console accurately displays the Google result, the view fails to update accordingly.
Appreciate any assistance on this matter.