Maps API called into admin page multiple times pulls in server key rather than browser key
Description
The console is showing this error: You have included the Google Maps JavaScript API multiple times on this page. This may cause unexpected errors.
In the source code:
Craft.registeredJsFiles["https://maps.googleapis.com/maps/api/js?key={BROWSER_KEY}"] = true;
| Craft.registeredJsFiles["https://maps.googleapis.com/maps/api/js?libraries=places&key={SERVER_KEY}"] = true;
The map field is showing an error due to a referrer issue as the browser key is restricted to particular referrers, and the server key is restricted to IP. As the server key is being called on the frontend that causes a failure. You can't set a restriction on both referrer and IP, so the only option I have is to remove the restriction on IP but I've seen keys scraped in the past that have lead to huge billing issues.
Additional info
- Craft version: 3.5.0
- Maps version: 3.9.0.2
Hey. Has this plugin been abandoned?
We encountered the exact same issue today. Is there a solution to this problem other then removing the restrictions from the APIs?
Additional info
- Craft Version: 3.7.65
- Maps version: 3.9.4