My favorites | Sign in
Project Logo
                
Feeds:
People details
Project owners:
  david.g.hong

jquery.googlemap ($.googlemap)

A simple jQuery plugin which handles integration of Google Maps (API). It works on top of both jQuery and Google Maps API v2 - and you can instantiate a working Google map with just:

// Javascript
// minimal code setup (requires jQuery 1.2+ and Google Maps API v2
$(".map").googlemap({addresses: ["1 ABC ST, NSW 2193 Sydney, Australia"]});

It returns jQuery object for chaining and it also has its own API:

// instance of jquery.googlemap object from above instantiation
var api = $(".map").googlemap();
// HTML
<div class="map"></div>

Try for yourself and see!


More examples

Full option set

// Javascript
// instantiate by giving full options
var locations = new Array();
locations = [
    "1 ABC St, Cantebury UK",
    "2 XYZ St, Yorkshire US"
];

$(".map").googlemap({
    labels: true, controls: true, zoom: 3, latitude: -23, longitude: 133, 
    html: ".popup-content", anchor: ".external-map-marker", addresses: locations,
    debug: false
});
// HTML
<div class="map"></div>
<p class="hidden popup-content">This is 1 ABC St, Canterbury UK</p>
<p class="hidden popup-content">This is 2 XYZ St, Yorkshire US</p>
<a class="external-map-marker">1 ABC St</a>
<a class="external-map-marker">2 XYZ St</a>

Chainability

$(".map")
    .googlemap({addresses: locations})
    .each(function() { alert($(this).attr("id")); });








Hosted by Google Code