地图坐标服务

接口信息

  • URL:http://api.haoservice.com/geoconv/v1

支持格式:json

http请求方式:GET POST

DEMO:http://api.haoservice.com/geoconv/v1?lnglatInfor=114.21892734521,29.575429778924;114.21892734521,29.575429778924&type=1&key=key

返回结果:

{"error_code":0,

                     "reason":"成功",

                     "result":[{"lng":114.23075330435,"lat":29.579086475808},

                     {"lng":114.23075006252,"lat":29.579083992217}]

}


演示示例代码:

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Net.Security;

using System.Security.Cryptography.X509Certificates;

using System.Net;

using System.IO;

using System.IO.Compression;

using System.Text.RegularExpressions;

using System.Web.Script.Serialization;

namespace map

{

    class Program

    {

        static void Main(string[] args)

        {

            string key = "****************";

            string lnglatInfor = "*****************";

            int type=1;

            string url = "http://api.haoservice.com/geoconv/v1?lnglatInfor="+lnglatInfor+"&type="+type+"&key="+key;

            WebClient wc = new WebClient();

            wc.Encoding = Encoding.UTF8;

            string str = wc.DownloadString(url);

            Console.WriteLine(str);

            Console.ReadKey();


        }

    }

}


你可能感兴趣的:(地图坐标服务)