Skip to content

Instantly share code, notes, and snippets.

@tjhole
Created November 3, 2013 20:32
Show Gist options
  • Save tjhole/7294479 to your computer and use it in GitHub Desktop.
Save tjhole/7294479 to your computer and use it in GitHub Desktop.
JQUERY: Quick Google Map
<script type="text/javascript"
src="http://maps.google.com/maps/api/js?sensor=false">
</script>
<script type="text/javascript">
var $map = jQuery.noConflict();
$map( document ).ready(function() {
var latlng = new google.maps.LatLng(<?php the_field('location_gps');?>);
var myOptions = {
zoom: 17,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map_canvas"),
myOptions);
// Creating a marker and positioning it on the map
var marker = new google.maps.Marker({
position: new google.maps.LatLng(<?php the_field('location_gps');?>),
map: map
});
});
</script>
<div id="map_canvas" style="width:100%; min-height:500px; height:100%"></div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment