Gps 获取传单中的高度和标题

Gps 获取传单中的高度和标题,gps,geolocation,leaflet,Gps,Geolocation,Leaflet,我正在为我的移动应用程序使用传单。我可以毫无问题地访问e.latlng和e.accurity,但e.speed和e.heading返回未定义 $scope.makeFit = function() { leafletData.getMap().then(function(map) { map.locate({setView: true, maxZoom: 16, watch:true,enableHighAccuracy: true}); map.

我正在为我的移动应用程序使用传单。我可以毫无问题地访问e.latlng和e.accurity,但e.speed和e.heading返回未定义

$scope.makeFit = function() {
        leafletData.getMap().then(function(map) {
        map.locate({setView: true, maxZoom: 16, watch:true,enableHighAccuracy: true});
        map.on('locationfound', onLocationFound);
         punto = L.circleMarker([35.80048816577000, 9.634765625], {color: '#136AEC', fillColor: '#2A93EE',fillOpacity: 0.7, weight: 2,opacity: 0.9, radius: 4}).addTo(map);
         function onLocationFound(e) {
       var radius = e.accuracy / 2;
       punto.setLatLng(e.latlng);

      alert(e.altitude);


  }

        });
      };

这是特定设备的实现细节-有些手机或计算机支持航向和速度,有些则不支持。传单并不能保证这一点,所以传单只是在活动中向你传递你的设备提供的信息