vercel / vercel/next.js

[GoogleMapsEmbed] "directions" mode can't work

Open
#81,591 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
142k
Forks
32.4k
Avg merge
2d 14h
Merged PRs (30d)
351

Description

Link to the code that reproduces this issue

https://codesandbox.io/p/sandbox/github/vercel/next.js/tree/canary/examples/reproduction-template

To Reproduce
  1. clone the example repository: https://github.com/vercel/next.js/tree/canary/examples/with-google-maps-embed
  2. Follow the "How to use" section
  3. Insert a new map with the "directions" mode including required parameters "origin" and "destination" (documentation) like this:
<GoogleMapsEmbed
      apiKey="CHANGE_ME"
      height={200}
      width="100%"
      mode="directions"
      origin="Brooklyn+Bridge,New+York,NY"
      destination="Paris,France"
    />
Current vs. Expected behavior

The map cannot load: Google Maps Platform rejected your request. Invalid request. Missing the 'origin' parameter.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the examples/with-google-maps-embed example and the GoogleMapsEmbed usage shown in the issue. Reproduce the directions mode request with origin and destination, then trace the component's generated Google Maps Embed URL to identify why origin is missing. Done means the example loads a directions map with both required parameters.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nextjs, react
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.