>>53 // グローバル変数 var currentPos = new google.maps.LatLng({lat: 32.xxx, lng: 130.xxx});
//--------------------------------------------------------------------- // watchPositionSuccessCallback() 現在位置取得Success //--------------------------------------------------------------------- function watchPositionSuccessCallback(pos) { currentPos = {lat: pos.coords.latitude, lng: pos.coords.longitude}; // あ、これがダメなのか?ここでnewしろと? var from = new google.maps.LatLng(currentPos); // ここで from に new しないで var to = google.maps.geometry.spherical.computeOffset(from, 350, heading); // 直に currentPos を使うとエラーが出ます
currentPos = {lat: a, lng: b}; って構文は currentPos変数が保持してるLatLngオブジェクトのlatにaを代入、lngにbを代入する、 って思ってたんだけど違うのかなぁ?