0

textboxのページには、locationname とbuttontextを取得する がありますgetLat&Long。ここでclicking、ボタンに と の場所を表示する必要alertlatitudeありlongitudeますtextbox。なにか提案を?
googleapis b'coz は、この制限の後にいくつかの段階の制限があるため、私に提案をしないでください。これは私の試みgoogleapisです:-

<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
 <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
function myIP(){
$("#btn").click(function(){
            var geocoder =  new google.maps.Geocoder();
    geocoder.geocode( { 'address': '#city'}, function(results, status) {
          if (status == google.maps.GeocoderStatus.OK) {
            alert("location : " + results[0].geometry.location.lat() + " " +results[0].geometry.location.lng()); 
          } else {
            alert("Something got wrong " + status);
          }
        });
});
}
 </script>
</head>
<body onload="myIP()">
<input type="text" id= "city">
<input id="btn" type="button" value="get Lat&Long" />
</body>
</html>

ありがとう。

4

1 に答える 1