Leaflet 实时地理定位
我想用ionic构建移动应用程序,首先用户是地理定位的我想每2秒更新一次他的位置这是地理定位的代码Leaflet 实时地理定位,leaflet,ionic-framework,Leaflet,Ionic Framework,我想用ionic构建移动应用程序,首先用户是地理定位的我想每2秒更新一次他的位置这是地理定位的代码 $scope.makeFit = function() { leafletData.getMap().then(function(map) { map.locate({setView: true, maxZoom: 16}); var marker; function onLocationFound(e) { marker= new L.Marker(e.l
$scope.makeFit = function() {
leafletData.getMap().then(function(map) {
map.locate({setView: true, maxZoom: 16});
var marker;
function onLocationFound(e) {
marker= new L.Marker(e.latlng);
marker.addTo(map)
.bindPopup("" + e.latlng + " ");
}
map.on('locationfound', onLocationFound);
});
};
请说明哪些文档记录了执行此操作的
locate()
的watch
选项。请澄清您想问什么。我的地图上有一个标记,表示当前位置,我正试图让它每2秒钟移动一次,以跟踪用户的位置