<div class="codetitle"> <span><a style="CURSOR: pointer" data="65617" class="copybut" id="copybut65617" onclick="doCopy('code65617')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code65617"> <br> <br> <br><title></title> <br>//在这里要注意js的引入顺序 <br><link href="css/jquery.ui.base.css" rel="stylesheet" type="text/css"> <br><link href="css/jquery.ui.theme.css" rel="stylesheet" type="text/css"> <br><script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script> <br><script src="js/jquery-1.9.1.js" type="text/javascript"></script> <br><script src="js/jquery.mousewheel.js" type="text/javascript"></script> <br><script src="js/jquery.ui.core.js" type="text/javascript"></script> <br><script src="js/jquery.ui.widget.js" type="text/javascript"></script> <br><script src="js/jquery.ui.button.js" type="text/javascript"></script> <br><script src="js/jquery.ui.spinner.js" type="text/javascript"></script> <br><link href="css/demos.css" rel="stylesheet" type="text/css"> <br><script type="text/javascript"> <BR>$(function () { <BR>function latlong() { <BR>return new google.maps.LatLng($("#lat").val(), $("#lng").val()); <BR>} <BR>function position() { <BR>map.setCenter(latlong()); <BR>} <BR>$("#lat, #lng").spinner({ <BR>step: .001, <BR>change: position, <BR>stop: position <BR>}); <BR>var map = new google.maps.Map($("#map")[0], { <BR>zoom: 8, <BR>center: latlong(), <BR>mapTypeId: google.maps.MapTypeId.ROADMAP <BR>}); <BR>}); <BR></script> <br><style type="text/css"> <BR>#map { <BR>width:500px; <BR>height:500px; <BR>} <BR></style> <br> <br> <br><label for="lat">纬度</label> <br><input id="lat" name="lat" value="44.797"> <br><br> <br><label for="lng">经度</label> <br><input id="lng" name="lng" value="-93.278"> <br><div id="map"></div> <br><div class="demo-description"> <br> </div> <br> <br> <br> </div>