components icon indicating copy to clipboard operation
components copied to clipboard

feat(Google Maps): Adding headers on the Google Maps Request for On-demand Rides and Deliveries (ODRD)

Open christianjosephdalisay opened this issue 3 years ago • 2 comments

Feature Description

There's a new Google Maps Solution: On-demand Rides and Deliveries. And, there's a requirement for adding a header on the Google Maps Request to register the specific request, not as a normal Google Maps API call, but as an ODRD call.

I am trying to add this header

X-Goog-Maps-Experience-ID: <tripID>

Reference is on this one is https://developers.google.com/maps/documentation/transportation-logistics-terms/on-demand-rides-deliveries-solution/managing-trips#_making_calls

This may be a feature request as I haven't seen implementation on this one.

Use Case

  • This will enable to route Google Maps Platform calls to ODRD calls. Thus, the billing set to be on Google Maps API will be changed to
  • This is overall on the implementation of On-demand Rides and Deliveries solution.

christianjosephdalisay avatar Sep 21 '22 06:09 christianjosephdalisay

Hello @xiandalisay ,

The @angular/google-maps package implements the Google Maps JavaScript API. If there is something in the Google Maps JavaScript API that is not implemented please file a bug here. For improvements with the Google Maps JavaScript API, the best place to file that is with the Google Maps JavaScript API itself.

-Zach

zarend avatar Sep 28 '22 00:09 zarend

Hello @xiandalisay ,

I may have resolved this issue prematurely :). Generally, we accept feature requests that can clearly be implemented with the Google Maps JavaScript API.

I noticed that there is a class in the javascript API that takes a tripId: https://developers.google.com/maps/documentation/javascript/reference/journey-sharing-trip-and-order-progress. Could you please let me know if it meets your needs? Then we can decide if we should move forward with this feature request.

-Zach

zarend avatar Sep 29 '22 16:09 zarend

@zarend I was able to do this by adding @types/google.maps on the google maps and having the apiVersion as beta.

    const loader = new Loader({
      // Replace with your API key
      apiKey: "YOUR_API_KEY",
      version: "beta",
      // @ts-ignore
      libraries: ["map"],
    });

Upon loading of the map, I added the header.

loader
      .load()
      .then((google) => {
google.maps.Settings.getInstance().experienceIds = [this.tripId];
});  

Thanks for the support!

christianjosephdalisay avatar Oct 22 '22 08:10 christianjosephdalisay

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.