/* The script include in the header */
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js&sensor=false&key=ABQIAAAA6kexzQ8dWZ7WYLi2Ujb6iRThfrz1fv6pUizwoe6TI79mCp3EBBS9VbAkdyTzVp5JPm5bkqeRYGyTlA"></script>
/* The div where the map will be located */
<div id="countauditor_map" style="width:1000px; height:500px"></div>
/* The actual script */
$(document).ready(function(){
initialize();
});
function initialize() {
var lat = ''; var lng = '';
var address = encodeURI('219 4th Ave N, Seattle, WA 98109'); // Address here
$.getJSON("http://maps.google.com/maps/geo?q="+address+"&key=ABQIAAAA6kexzQ8dWZ7WYLi2Ujb6iRThfrz1fv6pUizwoe6TI79mCp3EBBS9VbAkdyTzVp5JPm5bkqeRYGyTlA&sensor=false&output=json&callback=?",function(json){
lat = json.Placemark[0].Point.coordinates[1];
lng = json.Placemark[0].Point.coordinates[0];
var myOptions = {
zoom: 14,
center: new google.maps.LatLng(lat,lng),
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("countauditor_map"),myOptions);
var marker = new google.maps.Marker({
position: new google.maps.LatLng(lat,lng),
map: map,
});
});
}