+
Externally loaded Google Maps JavaScript API
+
+ The example demonstrates how to load the Google Maps API externally.
+
+
+
+ );
+}
+
+export default React.memo(ControlPanel);
diff --git a/examples/external-js-api/src/useExternallyLoadedMapsAPI.ts b/examples/external-js-api/src/useExternallyLoadedMapsAPI.ts
new file mode 100644
index 0000000..6677169
--- /dev/null
+++ b/examples/external-js-api/src/useExternallyLoadedMapsAPI.ts
@@ -0,0 +1,44 @@
+import {useEffect, useRef, useState} from 'react';
+
+/**
+ * Simple hook to load an external Maps API script and check if it is loaded.
+ * @param {String} url - URL of the script to load.
+ */
+export function useExternallyLoadedMapsAPI(url: string) {
+ const [isLoaded, setIsLoaded] = useState(false);
+ const intervalRef = useRef