我正在使用科爾多瓦建設設備平臺的谷歌地圖。查看谷歌地圖中的位置變化
我現在要問的是,如何檢查用戶位置是否改變?
因爲場景是,當用戶離開指定的地方時,頁面將被重定向到註銷頁面。
這裏是工作的地圖我有靜態地圖(無位置變化還)
var longitude = position.coords.longitude;
var latitude = position.coords.latitude;
var latLong = new google.maps.LatLng(latitude, longitude);
var mapOptions = {
center: latLong,
zoom: 18,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map"), mapOptions);
var marker = new google.maps.Marker({
position: latLong,
map: map,
title: 'my location'
});
因此函數來達到我想要的或多或少是這樣的:
var positionMust = x, -y;
if (latLong != positionMust)
{
window.location.href//to logout
}
我們需要檢查此用戶每次移走。
任何人都可以幫忙嗎?很多人提前感謝。