JS:
<script type="text/javascript"> var counts = ;
function starts() {
if (counts == ) {
alert('已经开启了实时监控!')
return false; }
if (confirm("确定开启实时监控?")) {
setInterval("GetJSMapGps()", ); //15秒
counts = ;
return true; }
else return false; }
function dw() { appletFrame.s_locationSet(124.805832, 46.571381);
} function GetJSMapGps() { var gpsX;
var gpsY;
gpsX = window.document.getElementById("hdflog").value; //经度
gpsY = window.document.getElementById("hdflag").value; //纬度
if (gpsX != null && gpsX != "" & gpsY != null && gpsY != "") {
appletFrame.s_locationSet(gpsX, gpsY); } } </script>
asp:
protected void Timer1_Tick(object sender, EventArgs e)
{
string id = ViewState["mobileid"].ToString();
if (!string.IsNullOrEmpty(id))
{
DataTable dtGps = GBLL.GetList(" imei = '" + id + "' order by intime desc ").Tables[];
if (dtGps.Rows.Count > )
{
string lat = dtGps.Rows[]["lat"].ToString();
string lon = dtGps.Rows[]["lon"].ToString();
hdflog.Value = lon;
hdflag.Value = lat;
}
}
}
protected void timersWatch_Click(object sender, EventArgs e)
{
Timer1.Interval = * ;//10秒 开启计时器
}