2017-10-11 8 views
-2

経度からデータを取得できません。静的に動作しますが、変数currentLatLng.longitutdeを使用すると、nullとなります。 これは私のコードです:位置座標から経度を取得

var currentLatLng = position.coords; 
var latlon = "Latitude" + currentLatLng.latitude + "," 
      + "Longitude" + currentLatLng.longitutde; 
var mappOptions = { 
    center: new google.maps.LatLng(currentLatLng.latitude, 
            currentLatLng.longitutde), 
    //center: new google.maps.LatLng(currentLatLng.latitude, 10.181531600000001), 
    zoom: 15, 
    mapTypeId: google.maps.MapTypeId.ROADMAP 
}; 
var DirectionsService = new google.maps.DirectionsService; 
var directionsDisplay = new google.maps.DirectionsRenderer; 
var geocoder = new google.maps.Geocoder; 
var map = new google.maps.Map(document.getElementById("map"), mappOptions); 
directionsDisplay.setMap(map); 

答えて

1

緯度経度ではなく、ロングティートです。

+0

おかげで仲間をlongitutdeない、それは経度ですオートコンプリートから注意を保つ...はい私は –

+0

は、私はあなたがSOに新しいユーザーであることを見ていることがわかりません。答えがあなたの問題を解決したら、それを合格とマークしてください。ありがとう。 – imerso

0

enter image description here

+0

オートコンプリートのスペルが間違っているということは、あなたが他の場所でミスペーストしたことを意味します。 – Svante

関連する問題