I have a requirement of replacing the existing default markers with my own custom Icons/Images as markers. But I dont see any such option in the direction service and map-directions-renderer component.

 <map-directions-renderer *ngIf="(directionsResults$ | async) as directionsResults"
                           [directions]="directionsResults" [suppressMarkers]="true"></map-directions-renderer>

 const request: google.maps.DirectionsRequest = {
      destination: {lat: 12, lng: 4},
      origin: {lat: this.originLat, lng: this.originLang},
      travelMode: google.maps.TravelMode.DRIVING,
    };
    this.directionsResults$ = mapDirectionsService.route(request).pipe(map(response => response.result));

Please check once.

0

There are 0 best solutions below