jquery-ui/demos/spinner/latlong.html

58 lines
1.4 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>
2011-08-07 16:59:50 +00:00
<link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
<script src="http://maps.google.com/maps/api/js?sensor=false"></script>
2012-09-21 01:41:47 +00:00
<script src="../../jquery-1.8.2.js"></script>
<script src="../../external/jquery.mousewheel.js"></script>
2011-08-07 16:59:50 +00:00
<script src="../../ui/jquery.ui.core.js"></script>
<script src="../../ui/jquery.ui.widget.js"></script>
<script src="../../ui/jquery.ui.button.js"></script>
<script src="../../ui/jquery.ui.spinner.js"></script>
<link rel="stylesheet" href="../demos.css">
<script>
2011-08-07 15:34:28 +00:00
$(function() {
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">
2011-08-07 16:59:50 +00:00
<p>Google Maps integration, using spinners to change latidude and longitude.</p>
2012-09-10 15:33:46 +00:00
</div>
2011-08-07 15:34:28 +00:00
</body>
</html>