我是geo位置的新手,我正在使用PHP。我想在我的网站上获取一张地图,我的网站上有一个人知道他的确切位置。他也应该像在swiggy.com中一样改变他在地图上的位置
答案 0 :(得分:0)
好的,我会告诉您已阅读Google Map API文档。谷歌搜索你要求的东西应该把你带到这里:
https://developers.google.com/maps/articles/geolocation
我要告诉你的是如何添加可拖动标记。
<tbody>
<tr ng-repeat ="data in log" ng-show="showAll || dataNotReceived(data.receivedTime)">
<td>{{data.UniqueId}}</td>
<td>{{data.Name}}</td>
<td ng-class ="{'data-notreceived' : dataNotReceived('data.receivedTime')}">{{data.receivedTime}}
</tr>
</tbody>
// in controller
$scope.showAll = true;
$scope.onButtonClick = function() {
$scope.showAll = !$scope.showAll;
return false;
}
您想要在停止向右拖动标记时更新用户坐标吗?
在这里你做到了。在前一行之后添加此事件侦听器:
var map = new google.maps.Map([...])
//After using geolocation and getting the user coordinates
var marker = new google.maps.Marker({
//Note this variable contains the previously created LatLng Object
//with the user position
position: userPosLatLng,
//Important so the user can realocate
draggable: true,
map: map,
title: 'You're here'
});