Created
February 19, 2015 14:43
Google Maps with jQuery Mobile
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
<!DOCTYPE HTML> | |
<html lang="fr"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Google Maps</title> | |
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.css" /> | |
<script src="http://code.jquery.com/jquery-1.5.2.min.js"></script> | |
<script src="http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.js"></script> | |
<script src="http://maps.google.com/maps/api/js?sensor=false"></script> | |
<style>.page-map, .ui-content, #map-canvas { width: 100%; height: 100%; padding: 0; }</style> | |
<script> | |
$('.page-map').live("pagecreate", function() { | |
//lat and lng of Paris | |
var lat = 48.857035, | |
lng = 2.352448; | |
var latlng = new google.maps.LatLng(lat, lng); | |
var myOptions = { | |
zoom: 14, | |
center: latlng, | |
mapTypeId: google.maps.MapTypeId.ROADMAP | |
}; | |
var map = new google.maps.Map(document.getElementById("map-canvas"),myOptions); | |
}); | |
</script> | |
</head> | |
<body> | |
<div data-role="page"> | |
<div data-role="header"><h1>Map View</h1></div> | |
<div data-role="content"> | |
<div id="map-canvas"> | |
<!-- map loaded here... --> | |
</div> | |
</div> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment