Require usage of @googlemaps/js-api-loader to dynamically load the Google Maps API.
📋 This rule is enabled in plugin:googlemaps/recommended
.
❌ Examples of incorrect code:
const script = document.createElement('script');
script.src = 'https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap';
const url = 'https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap';
✔️ Examples of correct code:
script.src = 'https://example.com' // some other script hostname