Re: Angular-leaflet-与Ionic一起使用的指令。我想知道是否有人知道如何将当前的GPS位置返回到地图上-相当于宣传单中的map.locate?非常感谢您的建议!
发布于 2014-07-16 18:57:43
您仍然可以像这样使用map.locate():
function MapCtrl($scope, leafletData) {
$scope.getLocation = function() {
leafletData.getMap('map').then(function(map) {
map.locate({setView: true, maxZoom: 16, watch: true, enableHighAccuracy: true});
map.on('locationfound', function (e) {
console.log(e.latlng, e.accuracy)
});
};
}https://stackoverflow.com/questions/24251104
复制相似问题