Hou*_*sem 3 leaflet ionic-framework
我想用离子构建移动应用程序,首先用户是地理位置我想每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.latlng);
marker.addTo(map)
.bindPopup("" + e.latlng + " ");
}
map.on('locationfound', onLocationFound);
});
};
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
2158 次 |
最近记录: |