使用数据库中的数据自动移动图钉。 [英] Auto moving pushpin using data from database.

查看:76
本文介绍了使用数据库中的数据自动移动图钉。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以帮助我,如何使用数据库中的数据移动图钉

Can anyone help me, how to moving the pushpin using data from database

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1"  runat="server">
    <title>Test Moving</title>
</head>
<body>
    <form id="form1"  runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div>
        <uc1:GoogleMapForASPNet ID="GoogleMapForASPNet1"  runat="server" />
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <asp:Timer ID="Timer1" runat="server" Interval="2000" OnTick="Timer1_Tick">
                </asp:Timer>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
    </form>
</body>
</html>







这是代码背后




This is code behind

using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class TestMoving : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        GoogleMapForASPNet1.GoogleMapObject.APIKey = ConfigurationManager.AppSettings["GoogleAPIKey"];
        GoogleMapForASPNet1.GoogleMapObject.Width = "100%";
        GoogleMapForASPNet1.GoogleMapObject.Height = "600px";
        GoogleMapForASPNet1.GoogleMapObject.ZoomLevel = 5;
        GoogleMapForASPNet1.GoogleMapObject.AutomaticBoundaryAndZoom = false;
        GoogleMapForASPNet1.GoogleMapObject.CenterPoint = new GooglePoint("1", 4.940170, 106.363836);

        GooglePoint GP1 = new GooglePoint();
        GP1.ID = "RedCar";
        GP1.Latitude = 3.204382;
        GP1.Longitude = 101.758385;
        GP1.InfoHTML = "This is Pushpin 1";

        GP1.IconImage = "icons/RedCar.png";
        GoogleMapForASPNet1.GoogleMapObject.Points.Add(GP1);
    }
    protected void Timer1_Tick(object sender, EventArgs e)
    {
        GoogleMapForASPNet1.GoogleMapObject.Points["RedCar"].Longitude += 0.001;
    }
}





这是来自数据库的数据



纬度经度

3.204382 101.758385

3.20432 101.75843

3.20425 101.758499

3.204172 101.75856

3.20409 101.758629

3.204011 101.758705

3.203927 101.758789

3.203834 101.758858

3.203743 101.758934

3.20365 101.759003

3.203558 101.759079

3.20347 101.759148

3.203383 101.759209



This is data from database

Latitude Longitude
3.204382 101.758385
3.20432 101.75843
3.20425 101.758499
3.204172 101.75856
3.20409 101.758629
3.204011 101.758705
3.203927 101.758789
3.203834 101.758858
3.203743 101.758934
3.20365 101.759003
3.203558 101.759079
3.20347 101.759148
3.203383 101.759209

推荐答案

这篇关于使用数据库中的数据自动移动图钉。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆