ionic-team / ionic-native-google-maps

Google maps plugin for Ionic Native
Other
221 stars 125 forks source link

DistanceMatrixService missing - @ionic-native/google-maps #180

Closed humanely closed 5 years ago

humanely commented 5 years ago

Hi,

We had an old app running on non-native google maps. We need to compute time and distance between 2 points and travel routes. For the same , below code used to work fine.

public  service : any = new google.maps.DistanceMatrixService();
this.service.getDistanceMatrix(
         {
           origins: [start, this.gCode.locationName],
           destinations: [destinationName, stop],
           travelMode: 'DRIVING',
           unitSystem: google.maps.UnitSystem.METRIC,
           avoidHighways: false,
           avoidTolls: false,
         }, (response, status) => {
           this.callback(response, status)
         })

But in @ionic-native/google-maps, I only find a spherical distance calculator. Is there anyway to calculate driving distance and routes in native-maps?

wf9a5m75 commented 5 years ago

Nope. You need to implement it with Google Maps JavaScript API or direct handle of Google Maps Distance Matrix API.