Пример #1
0
        static void showconver()
        {
            double lng = 116.403945;
            double lat = 39.915122;

            double[] tdt = LbsTrans.BD09toGCJ02(lng, lat);
            Console.WriteLine(tdt[0] + ", " + tdt[1]);
        }
Пример #2
0
        /// <summary>
        /// 调用转换坐标
        /// </summary>
        static void transLBS()
        {
            LbsTrans lt = new LbsTrans();

            lt.copydata_bd2gcj();
            Console.WriteLine("BD09 -> GCJ02   completed");
            lt.copydata_bd2wgs();
            Console.WriteLine("BD09 -> WGS84   completed");
        }
Пример #3
0
        static void testcontent()
        {
            double[]          ct  = LbsTrans.BD09toGCJ02(106.720537, 26.615896);
            UseFunction       uf  = new UseFunction();
            IList <LocalData> ls  = uf.get_local("司法行政机关");
            string            tmp = LbsMaker.MakeMap(ct[0] + ", " + ct[1], "12", LbsMaker.MakeMapPoints(ls));

            File.WriteAllText("C:/ttxy/desktop/lbs/test.txt", tmp);
            Console.WriteLine(tmp);
        }
Пример #4
0
    protected void Button_submit_Click(object sender, EventArgs e)
    {
        SysFunction sf     = new SysFunction();
        LocalData   tmp    = this.U_localdata1.localdata;
        int         result = sf.add_localdata(tmp);

        double[] gcj = LbsTrans.BD09toGCJ02(tmp.Lng, tmp.Lat);
        tmp.Lng = gcj[0];
        tmp.Lat = gcj[1];
        result += sf.add_localdata_gcj(tmp);
        double[] wgs = LbsTrans.GCJ02toWGS84(tmp.Lng, tmp.Lat);
        tmp.Lng = wgs[0];
        tmp.Lat = wgs[1];
        result += sf.add_localdata_wgs(tmp);
        if (result == 3)
        {
            Response.Write("<script language='javascript'>alert('添加成功'); location.href='AddNode.aspx'</script>");
        }
        else
        {
            Response.Write("<script language='javascript'>alert('添加失败: 成功" + result + "条记录');");
        }
    }
Пример #5
0
 static void showconvert(double lng, double lat)
 {
     double[] ct = LbsTrans.BD09toGCJ02(106.720537, 26.615896);
     Console.WriteLine(ct[0] + "   " + ct[1]);
 }