dpa99c / phonegap-launch-navigator

Phonegap/Cordova plugin which launches native route navigation apps for Android, iOS and Windows
369 stars 129 forks source link

When navigate to google maps, always prompt user to continue on each stops. #245

Closed Astha-Anand closed 4 years ago

Astha-Anand commented 4 years ago

Bug report

Current behavior:

When navigate to google maps with 20 stops using launch navigator , it always prompts on every stop. When user reaches the first stop it asks user whether he wants to continue for next stop or not.

Expected behavior:

It should not prompt user to continue when they are riding a bike

Steps to reproduce:

  1. Bike rider redirected to google maps with 20+ selected stops through launch navigator
  2. When reaches first stop ,rider needs to click continue on all 20+ points to keep on track.

Environment information

iOS build issue:

Related code:

this.waypoints.map((waypoint, index) => {
          navigationString = navigationString.concat(
            `${waypoint.location.lat},${waypoint.location.lng}`
          );
          if (index < polylines.length - 1) {
            navigationString = navigationString.concat("+to:");
          }
        });

        if (this.platform.is("android")) {
          navigationString = escape(navigationString);
        } else {
          navigationString = navigationString.replace(/&/g, "AND");
        }
        console.log("encoded uri-->", navigationString);
        const destinationName = rideData.name;

        this.launchNavigator.availableApps().then((apps) => {
          console.log(apps);
        });
        launchnavigator.enableDebug(
          true,
          function(success: any) {
            console.log("Log enabled", success);
          },
          function(err: any) {
            console.log("Err enabled", err);
          }
        );

        this.launchNavigator
          .isAppAvailable(this.launchNavigator.APP.GOOGLE_MAPS)
          .then(
            (success)
 => {
              console.log("is Google maps available->", success);
              let app: any;
              if (success)
 {
                app = this.launchNavigator.APP.GOOGLE_MAPS;
              } else {
                console.warn("Google Maps not available");
                app = this.launchNavigator.APP.USER_SELECT;
              }

              const options: LaunchNavigatorOptions = {
                app,
                // start: latitude + "," + longitude,
                transportMode: this.launchNavigator.TRANSPORT_MODE.DRIVING,
                destinationName,
                extras: {},
              };
              if (this.avoidHighways) {
                options.extras.avoid = "highways";
              }

              this.launchNavigator.navigate(navigationString, options);
            },
            (err) => {
              console.log("App not aviaalble error", err);
            }
          );



Other information:

dpa99c commented 4 years ago

This plugin simply launches the Google Maps app. It cannot influence the behaviour of Google Maps once it has been launched.