Fork me on GitHub

initmap.js
a tiny jQuery plugin for embedding Google Maps
8.7kb minified, 1.7kb gzipped

Download initmap.min.js View on Github

About

initmap.js allows you to embed Google Maps in a nice, quick, and easy way.
The plugin gets rid of the boilerplate code to embed a Google Map. It also gives you flexibility if you need to do more complex things.

Getting Started

initmap.js has two dependencies:

They both need to be loaded before initmap.js :

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" type="text/javascript"></script>
<script src="https://maps.googleapis.com/maps/api/js?sensor=false" type="text/javascript"></script>
<script src="path_to_js_directory/initmap.min.js" type="text/javascript"></script>

Download initmap.js


Basic usage example

$('#map').initMap();

Default parameters (required by Google Maps to initialize the map):
center: lat: 0 / lng: 0
zoom: 2
type: hybrid

Checkout the documentation