基于jquery实现控制经纬度显示地图与卫星
代码如下:
<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="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script> <script src="js/jquery-1.9.1.js" type="text/javascript"></script> <script src="js/jquery.mousewheel.js" type="text/javascript"></script> <script src="js/jquery.ui.core.js" type="text/javascript"></script> <script src="js/jquery.ui.widget.js" type="text/javascript"></script> <script src="js/jquery.ui.button.js" type="text/javascript"></script> <script src="js/jquery.ui.spinner.js" type="text/javascript"></script> <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>
相关推荐
hhanbj 2020-11-17
81427005 2020-11-11
EdwardSiCong 2020-11-23
85477104 2020-11-17
seoppt 2020-09-13
honeyth 2020-09-13
WRITEFORSHARE 2020-09-13
84483065 2020-09-11
momode 2020-09-11
85477104 2020-08-15
83510998 2020-08-08
82550495 2020-08-03
tthappyer 2020-08-03
84901334 2020-07-28
tthappyer 2020-07-25
TONIYH 2020-07-22
tztzyzyz 2020-07-20
83510998 2020-07-18
81463166 2020-07-17