jquery-ui/demos/spinner/latlong.html

51 lines
1.2 KiB
HTML
Raw Normal View History

2011-08-07 16:59:50 +00:00
<!doctype html>
2011-08-07 15:34:28 +00:00
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery UI Spinner - Map</title>
<link rel="stylesheet" href="../../themes/base/all.css">
2011-08-07 16:59:50 +00:00
<link rel="stylesheet" href="../demos.css">
<script src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script src="../../external/requirejs/require.js"></script>
<script src="../bootstrap.js" data-modules="external/jquery-mousewheel/jquery.mousewheel">
2011-08-07 15:34:28 +00:00
function latlong() {
2011-08-07 16:59:50 +00:00
return new google.maps.LatLng( $("#lat").val(), $("#lng").val() );
2011-08-07 15:34:28 +00:00
}
function position() {
2011-08-07 16:59:50 +00:00
map.setCenter( latlong() );
2011-08-07 15:34:28 +00:00
}
2011-08-07 16:59:50 +00:00
$( "#lat, #lng" ).spinner({
2011-09-14 13:49:17 +00:00
step: .001,
change: position,
stop: position
2011-08-07 15:34:28 +00:00
});
2011-08-07 16:59:50 +00:00
var map = new google.maps.Map( $("#map")[0], {
2011-08-07 15:34:28 +00:00
zoom: 8,
center: latlong(),
mapTypeId: google.maps.MapTypeId.ROADMAP
});
</script>
<style>
2011-08-07 16:59:50 +00:00
#map {
width:500px;
height:500px;
}
2011-08-07 15:34:28 +00:00
</style>
</head>
<body>
<label for="lat">Latitude</label>
2011-09-14 13:49:17 +00:00
<input id="lat" name="lat" value="44.797">
2011-08-07 16:59:50 +00:00
<br>
2011-08-07 15:34:28 +00:00
<label for="lng">Longitude</label>
2011-09-14 13:49:17 +00:00
<input id="lng" name="lng" value="-93.278">
2011-08-07 15:34:28 +00:00
<div id="map"></div>
<div class="demo-description">
2013-11-18 22:45:12 +00:00
<p>Google Maps integration, using spinners to change latitude and longitude.</p>
2012-09-10 15:33:46 +00:00
</div>
2011-08-07 15:34:28 +00:00
</body>
</html>