复制代码 代码如下:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
//在这里要注意js的引入顺序
<link href="css/jquery.ui.base.css" rel="stylesheet" type="text/css" />
<link href="css/jquery.ui.theme.css" rel="stylesheet" type="text/css" />
<script src="/UploadFiles/2021-04-02/js?sensor=false"><script src="js/jquery-1.9.1.js"><script src="/UploadFiles/2021-04-02/jquery.mousewheel.js"><script src="js/jquery.ui.core.js"><script src="/UploadFiles/2021-04-02/jquery.ui.widget.js"><script src="js/jquery.ui.button.js"><script src="/UploadFiles/2021-04-02/jquery.ui.spinner.js"><link href="css/demos.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
$(function () {
function latlong() {
return new google.maps.LatLng($("#lat").val(), $("#lng").val());
}
function position() {
map.setCenter(latlong());
}
$("#lat, #lng").spinner({
step: .001,
change: position,
stop: position
});
var map = new google.maps.Map($("#map")[0], {
zoom: 8,
center: latlong(),
mapTypeId: google.maps.MapTypeId.ROADMAP
});
});
</script>
<style type="text/css">
#map {
width:500px;
height:500px;
}
</style>
</head>
<body>
<label for="lat">纬度</label>
<input id="lat" name="lat" value="44.797"/>
<br>
<label for="lng">经度</label>
<input id="lng" name="lng" value="-93.278"/>
<div id="map"></div>
<div class="demo-description">
</div>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
//在这里要注意js的引入顺序
<link href="css/jquery.ui.base.css" rel="stylesheet" type="text/css" />
<link href="css/jquery.ui.theme.css" rel="stylesheet" type="text/css" />
<script src="/UploadFiles/2021-04-02/js?sensor=false"><script src="js/jquery-1.9.1.js"><script src="/UploadFiles/2021-04-02/jquery.mousewheel.js"><script src="js/jquery.ui.core.js"><script src="/UploadFiles/2021-04-02/jquery.ui.widget.js"><script src="js/jquery.ui.button.js"><script src="/UploadFiles/2021-04-02/jquery.ui.spinner.js"><link href="css/demos.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
$(function () {
function latlong() {
return new google.maps.LatLng($("#lat").val(), $("#lng").val());
}
function position() {
map.setCenter(latlong());
}
$("#lat, #lng").spinner({
step: .001,
change: position,
stop: position
});
var map = new google.maps.Map($("#map")[0], {
zoom: 8,
center: latlong(),
mapTypeId: google.maps.MapTypeId.ROADMAP
});
});
</script>
<style type="text/css">
#map {
width:500px;
height:500px;
}
</style>
</head>
<body>
<label for="lat">纬度</label>
<input id="lat" name="lat" value="44.797"/>
<br>
<label for="lng">经度</label>
<input id="lng" name="lng" value="-93.278"/>
<div id="map"></div>
<div class="demo-description">
</div>
</body>
</html>
标签:
纬度,经度,查看地图
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
桃源资源网 Design By www.nqtax.com
暂无“jQuery根据纬度经度查看地图处理程序”评论...