[BUG] You have included the Google Maps API multiple times on this page. This may cause unexpected errors.
See original GitHub issueI’m using a basic example and the script is added each time, I don’t know if this is the intended behaviour or am I missing something.
This is my component:
import React from "react"
import { withScriptjs, withGoogleMap, GoogleMap, Marker } from "react-google-maps"
const Map = withScriptjs(withGoogleMap((props) =>
<GoogleMap
defaultZoom={17}
defaultCenter={{lat: 24.828797, lng: -107.441531}}
center={props.location}
defaultOptions={{ disableDefaultUI: true, gestureHandling: 'none' }}
>
{props.isMarkerShown && <Marker position={props.location} />}
</GoogleMap>
))
export default Map
Issue Analytics
- State:
- Created 5 years ago
- Reactions:11
- Comments:33
Top Results From Across the Web
"You have included the Google Maps API multiple times on ...
I'm getting the error "You have included the Google Maps API multiple times on this page. This may cause unexpected errors." I know...
Read more >You have included the Google Maps JavaScript API multiple ...
Got a problem with this You have included the Google Maps JavaScript API multiple times on this page. This may cause unexpected errors...
Read more >You have included the Google Maps API multiple times on this ...
You have included the Google Maps API multiple times on this page. This may cause unexpected errors. · Diagnosis: Duplicate Google Maps API....
Read more >You have included the Google Maps API multiple times on this ...
In the console it prints: "You have included the Google Maps API multiple times on this page. This may cause unexpected errors." "Google...
Read more >Fix: Google Maps JavaScript API Multiple Times On This Page ...
An error can be shown in the console when you are using JavaScript API multiple times on your page, that says: "You have...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
If you are having a script for google maps in your html element, then removing withScriptjs will solve the issue.
from Step 3: “If you don’t use withScriptjs, you have to put a <script/> tag for Google Maps JavaScript API v3 in your HTML’s <head/> element”
This can be solved by separating the
compose()
call that creates therender
environment and the layout functional component like so: