Skip to content
This repository has been archived by the owner on May 4, 2022. It is now read-only.

Got “Not Found” status from google-map directional service in ionic3? #399

Open
kapilSoni101 opened this issue Apr 20, 2019 · 0 comments

Comments

@kapilSoni101
Copy link

kapilSoni101 commented Apr 20, 2019

Short description of the problem:

Hi to all,
I have implemented the directional service in ionic3 but i got error "Not Found" every time.i am not able to show polyline between 2 distance.please check my below code what the wrong in my code?

What behavior are you expecting?

I have to draw the polyline between the two distance ?

    //loadRouteList function for set current lat and long
       loadRouteList() {
	  //set the service...
	  let directionsService = new google.maps.DirectionsService;
         this.directionsDisplay = new google.maps.DirectionsRenderer({
            polylineOptions: {
            strokeColor: '#40710C'
           }
      });

	      this.directionsDisplay.setMap(this.map);	
	      this.directionsDisplay.setPanel(this.directionsPanel.nativeElement);

	      //hold the start and end point in the map...
	       var start  = this.routeList[0].stop_name;
	       var end    = this.routeList[this.routeList.length- 1].stop_name;

	      directionsService.route({
	          origin: start,
	          destination: end,
	          travelMode: google.maps.TravelMode['DRIVING']
	      }, (res, status) => {

	         if(status == google.maps.DirectionsStatus.OK){
	             this.directionsDisplay.setDirections(res);
	          } else {
	             console.warn(status);
	          }
	      });
	  }```

**Which Ionic Version?** 
Ionic 3.9

I have used below link to implement the directional serveice but not working in my case why get "Not found status every time"?


Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant