
Product
Introducing Webhook Events for Pull Request Scans
Add real-time Socket webhook events to your workflows to automatically receive pull request scan results and security alerts in real time.
@googlemaps/loader
Advanced tools
NOTE: This package has been deprecated in favor of @googlemaps/js-api-loader. The interface remains the same.
Load the Google Maps V3 script dynamically. This takes inspiration from the google-maps npm package but updates it with ES6, Promises, and TypeScript.
Available via NPM as the package @googlemaps/loader
The reference documentation can be found at this link.
import { Loader } from '@googlemaps/loader';
const loader = new Loader({
apiKey: "",
version: "weekly",
libraries: ["places"]
});
const mapOptions = {
center: {
lat: 0,
lng: 0
},
zoom: 4
};
Using a promise for when the script has loaded.
// Promise
loader
.load()
.then(() => {
new google.maps.Map(document.getElementById("map"), mapOptions);
})
.catch(e => {
// do something
});
Alternatively, if you want to use a callback.
// Callback
loader.loadCallback(e => {
if (e) {
console.log(e);
} else {
new google.maps.Map(document.getElementById("map"), mapOptions);
}
});
View the package in action here.
This library is community supported. We're comfortable enough with the stability and features of the library that we want you to build real production applications on it.
If you find a bug, or have a feature suggestion, please log an issue. If you'd like to contribute, please read How to Contribute.
FAQs
Wrapper for the loading of Google Maps script in the browser
We found that @googlemaps/loader demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Add real-time Socket webhook events to your workflows to automatically receive pull request scan results and security alerts in real time.
Research
The Socket Threat Research Team uncovered malicious NuGet packages typosquatting the popular Nethereum project to steal wallet keys.
Product
A single platform for static analysis, secrets detection, container scanning, and CVE checks—built on trusted open source tools, ready to run out of the box.