Fork me on GitHub

jQuery gMap - Google Maps API V3

gMap is a jQuery plugin that helps you embed Google Maps into your website. With less than 2 KB (minified and gzipped) in size it is very flexible and highly customizable

Original version by Cedric Kasner, modified by Mario Estrada to use the Google Maps API V3.

Examples

Default View

This will be replaced with the Google Map.

Code:

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

Custom Controls and Map Type

This will be replaced with the Google Map.

Code:

$('#map_controls').gMap(
{
     latitude: -2.206,
     longitude: -79.897,
     maptype: 'TERRAIN',
     zoom: 8,
     controls: {
         panControl: true,
         zoomControl: false,
         mapTypeControl: true,
         scaleControl: false,
         streetViewControl: false,
         overviewMapControl: false
     }
});

Markers

This will be replaced with the Google Map.

Code:

 $('#map_addresses').gMap({
	address: "Quito, Ecuador",
	zoom: 5,
	markers:[
		{
			latitude: -2.2014,
			longitude: -80.9763,
			html: "_latlng"
		},
		{
			address: "Guayaquil, Ecuador",
			html: "My Hometown",
			popup: true
		},
		{
			address: "Galapagos, Ecuador",
			html: "_address"
		}
	]
});

Kitchen Sink - Extended Usage

This will be replaced with the Google Map.

Code:

$("#map_extended").gMap({
	controls: false,
	scrollwheel: true,
	maptype: 'TERRAIN',
	markers: [
		{
			latitude: 47.670553,
			longitude: 9.588479,
			icon: {
				image: "images/gmap_pin_orange.png",
				iconsize: [26, 46],
				iconanchor: [12,46]
			}
		},
        {
			latitude: 47.65197522925437,
			longitude: 9.47845458984375
		},
		{
			latitude: 47.594996,
			longitude: 9.600708,
			icon: {
				image: "images/gmap_pin_grey.png",
				iconsize: [26, 46],
				iconanchor: [12,46]
			}
		}
	],
	icon: {
		image: "images/gmap_pin.png", 
		iconsize: [26, 46],
		iconanchor: [12, 46]
	},
	latitude: 47.58969,
	longitude: 9.473413,
	zoom: 10
});