【问题标题】:get longitude from position coords从位置坐标获取经度
【发布时间】:2018-03-23 15:41:04
【问题描述】:

我无法从经度检索数据。它静态地工作,但如果我使用变量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);

【问题讨论】:

    标签: javascript html google-maps google-maps-api-3 google-api


    【解决方案1】:

    是经度,不是经度。

    【讨论】:

      【解决方案2】:

      注意自动补全是经度,而不是经度

      【讨论】:

      • 自动完成拼写错误意味着您在其他地方也拼错了。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-05-27
      • 2020-05-04
      • 2019-09-08
      相关资源
      最近更新 更多