Skip to content

jamiewinder/systemjs-plugin-googlemaps

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

systemjs-plugin-googlemaps

SystemJS plugin to load Google Maps

jspm install systemjs-googlemaps=github:HeinrichFilter/systemjs-plugin-googlemaps

In config.js:

System.config({
  "paths": {
    // putting this in "map" breaks SystemJS builder
    "google-maps": "https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&libraries=places"
  },
  "meta": {
    "google-maps": {
      "build": false, // exclude external Google Maps JS from SystemJS builder
      "loader": "systemjs-googlemaps"
    }
  }
});

In your app:

System.import('google-maps').then(function (GoogleMaps) {
    new GoogleMaps.Map(document.getElementById('map'), {
        center: {lat: -28.0, lng: 22.0},
        zoom: 6
    });
});

References

This code was adapted from various places:

About

SystemJS plugin to load Google Maps

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 50.7%
  • JavaScript 49.3%