Created
November 3, 2013 20:32
-
-
Save tjhole/7294479 to your computer and use it in GitHub Desktop.
JQUERY: Quick Google Map
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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