skip to Main Content

I’m currently working on a Next.js project and I’m looking for the best npm package to integrate Google Maps Platform. Despite extensive searching, I haven’t been able to find a suitable package or clear documentation on how to implement it. Could someone please provide recommendations or guidance on how to effectively integrate Google Maps Platform into a Next.js project? Any help or insights would be greatly appreciated.

I tried react-google-maps/api but it doesnt have a guide

2

Answers


  1. try to use ‘@next/third-parties’ library:

    import { GoogleMapsEmbed } from '@next/third-parties/google'
    
    export default function Page() {
     return (
      <GoogleMapsEmbed
       apiKey="XYZ"
       height={200}
       width="100%"
       mode="place"
       q="Brooklyn+Bridge,New+York,NY"
     />
     )
    }
    

    Here is the documentation:
    https://nextjs.org/docs/app/building-your-application/optimizing/third-party-libraries

    Login or Signup to reply.
  2. Your issue seems to be related to the lack of documentation for the google-maps-api. I don’t know what research you’ve done but I have something that could be of use.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search