Created
July 30, 2012 08:21
-
-
Save mashit/3205645 to your computer and use it in GitHub Desktop.
Jquery Ui Map example (Locations are inaccurate)
This file contains 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
<html> | |
<head> | |
<title>Map Demo | |
</title> | |
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&libraries=places"></script> | |
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.min.js"></script> | |
<script type="text/javascript" src="http://jquery-ui-map.googlecode.com/svn/trunk/ui/jquery.ui.map.js"></script> | |
<script type="text/javascript" src="http://jquery-ui-map.googlecode.com/svn/trunk/ui/jquery.ui.map.services.js"></script> | |
<script type="text/javascript" src="http://jquery-ui-map.googlecode.com/svn/trunk/ui/jquery.ui.map.extensions.js"></script> | |
<script type="text/javascript"> | |
$(document).ready(function(){ | |
$('#map_canvas').gmap({ 'center': '39.744244, -104.834960' }); | |
$('#map_canvas').gmap().bind('init', function() { | |
$('#map_canvas').gmap('addControl', 'control', google.maps.ControlPosition.LEFT_TOP); | |
$('#map_canvas').gmap('option', 'zoom', 12); | |
$('#map_canvas').gmap('addMarker', { /*id:'m_1',*/ 'position': '39.744244, -104.834960', 'bounds': false } ); | |
$('#map_canvas').gmap('displayDirections', { 'origin': '39.744783, -104.831709', 'destination': '39.744244, -104.834960', 'travelMode': google.maps.DirectionsTravelMode.WALKING }, { 'panel': document.getElementById('panel') }, function(result, status) { | |
if ( status === 'OK' ) { | |
alert('Results found!'); | |
} | |
}); | |
}); | |
}); | |
</script> | |
</head> | |
<body> | |
<div id="map_canvas" style="height:600px;"></div> | |
<div id="panel" style="height: 200px;width: 300px;"></div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Update the links please, not working anymore :(