I am using cordova in building the google map for device platform.
What I am going to ask is that, how to check if the user position is change?
Because the scenario is, when user is away from the specified place, the page will be redirected to logout page.
Here is the working map I have for static map (with no position change yet)
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'
});
So the function to achieve what I want is more or less like this:
var positionMust = x, -y;
if (latLong != positionMust )
{
window.location.href//to logout
}
We need to check this everytime user is moving away.
Can anybody help? Many many thanks in advance.