Quick start
Obviously, because gmap3 is a jQuery plugin, you need first to load jQuery.
-
Include gmap3 by using one of:
- Use the cdn https://cdn.jsdelivr.net/gmap3/7.2.0/gmap3.min.js
- Download the latest version on github
- install it using bower or npm:
bower install gmap3 # or npm install gmap3
-
Load it into your HTML pages:
<script src="path/to/gmap3.min.js"></script>
-
The Google Maps API is asynchronously loaded as described on the official page.
If needed, you can load it explicitly to configure it (see documentation):<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY®ion=GB"></script>
-
Google Maps require a width / height to display maps, prepare your CSS as well, e.g.
gm-map { display: block; width: 100%; height: 300px; }
-
Start to use gmap3, e.g.
$('#map').gmap3({ address: "Haltern am See, Weseler Str. 151", zoom: 6, mapTypeId : google.maps.MapTypeId.ROADMAP });