1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
| <!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Entrega 5</title>
<link href="/style.css" rel="stylesheet" type="text/css" media="all">
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>
<script type="text/javascript" src="gmaps.js"></script>
<script type="text/javascript" src="http://zeptojs.com/zepto.min.js"></script>
<script type="text/javascript">
var map, lat, lng;
$(function(){
function geolocalizar(){
GMaps.geolocate({
success: function(position){
lat = position.coords.latitude;
lng = position.coords.longitude;
var map = new GMaps({
el: '#map',
lat: lat,
lng: lng
});
map.addMarker({lat: lat, lng: lng});
},
error: function(error) {alert ('Error '+error.message);},
not_supported: function(){alert('No soporta geolocalización')},
});
};
geolocalizar();
});
</script>
</head>
<body>
<h1>Geolocalización y Mapas</h1>
<div id="map"></div>
</body>
</html> |
Partager