Skip to content
This repository was archived by the owner on May 4, 2022. It is now read-only.
This repository was 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

@kapilSoni101

Description

@kapilSoni101

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"?


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions