create table geo( geo_id INT NOT NULL AUTO_INCREMENT, lng float NOT NULL, lat float NOT NULL, name ) NULL, PRIMARY KEY ( geo_id ) ); INSERT INTO `geo`(`lng`, `lat`, `name`) VALUES (118.302416,33.958887,"实验小学"); INSERT INTO `geo`(`lng`, `lat`, `n…
创建geo表 create table geo( geo_id INT NOT NULL AUTO_INCREMENT, lng float NOT NULL, lat float NOT NULL, name VARCHAR(100) NULL, PRIMARY KEY ( geo_id ) ); INSERT INTO `geo`(`lng`, `lat`, `name`) VALUES (118.302416,33.958887,"实验小学"); INSERT INTO `geo…
调用百度api,根据经度和纬度获取地理位置信息,返回Json. C#代码: using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System; using System.Net.Http; public class LocationService { //百度api private static string url = @"http://api.map.baidu.com/geocoder/v2/?location={0}&…
废话不多说,直接上代码: 1.首先新建几个类,定义一些属性: public class BaiDuGeoCoding { public int Status { get; set; } public Result Result { get; set; } } public class Result { public Location Location { get; set; } public string Formatted_Address { get; set; } public string…