gps - Obtaining altitude and heading in leaflet -
im using leaflet mobile app. can gain access e.latlng , e.accuracy no problem e.speed , e.heading return undefined
$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); } }); };
this implementation detail of specific device - phones or computers support heading , speed, don't. it's not leaflet can guarantee, leaflet passes device offers on in event.
Comments
Post a Comment