Tag: 谷歌地图

C#ASP.NET MVC项目和Google Maps:如何使用C#List 中的值填充JavaScript数组

我有这样一个类: public class Markers { public double latitude { get; set; } public double longitude { get; set; } //Constructors and Methods //(…) } 在我的控制器上,我有一个带有标记列表的ActionResult,我像这样添加纬度和经度 List listM = new List(); //NOTE: this is outside of my ActionResult, no problem with that. //(…) listM.Add(new Markers(value[0], value[1])); //NOTE: value[0] is my lat and value[1] is my longitude […]

生成谷歌地图图像

我想允许我网站的最终用户生成谷歌地图的图像。 用户在谷歌地图上选择其位置后可以生成图像,这怎么可能?

如何找到两个地方之间的位置?

我有两个文本框,其中用户输入他的源和目的地,当用户按下提交按钮时,在源处绘制一个标记,而在目的地绘制另一个标记,那么任何人都可以告诉我如何找到中间位置吗? 使用谷歌地图api版本3。

使用C#中的Google Maps API和SSIS包获得行驶距离

更新:找到Google distancematrix并尝试相应地修改我的代码。 我在这里得到一个无效的参数错误: return new GeoLocation(dstnc, uri.ToString()); } catch { return new GeoLocation(0.0, “https://”); } 基本上,我需要从两个已知的纬度/长度获得行驶距离。 我正在使用SSIS包,我在网上发现了一个很棒的教程,非常接近于产生我需要的结果。 教程: http : //www.sqlmusings.com/2011/03/25/geocode-locations-using-google-maps-v3-api-and-ssis/ 他们正在做的是将已知的街道地址传递给Google并从返回的XML中读取lat / long。 我需要做的不同的是传递两个已知的纬度/长度并读取返回的距离。 示例: https : //maps.googleapis.com/maps/api/distancematrix/xml?origins=32.1576780,%20-82.9070920&destinations=27.6536997,%20-81.5158944&mode=driving&units=imperial&sensor=false 他们使用C#,我不熟悉如何进行修改。 无论如何我还是刺了一下这就是我想出来的: using System; using System.Collections.Generic; using System.Text; //added these using System.Data; using System.Net; using System.Web; using System.Xml; // THIS CODE AND INFORMATION ARE PROVIDED “AS […]

Google Geolocation API – 使用经度和纬度在文本框中获取地址?

我注意到有很多关于如何根据IP地址使用Google地理定位查看位置的信息。 但我想知道是否以及如何使用此服务输入位置(经度和纬度)并返回当前地址,或至少是一个城市,州。 我想在C#中这样做,但我会使用任何语言。 任何建议?

jsonconvert.deserializeobject返回null

当用户输入地址(现在)的2个值(如城市和街道)时,我正试图从谷歌地图获取坐标。遇到来自谷歌地图api的Json字符串反序列化的麻烦。必须非常简单请帮助我关于我所缺少的。 这是json字符串: http : //pasted.co/d9e7c1de 我需要结果/几何/位置/ lat,结果/几何/位置/ lng信息 这是我的代码: public class Geometry { [JsonProperty(“bounds”)] public Bounds bounds { get; set; } [JsonProperty(“location”)] public Location location { get; set; } [JsonProperty(“location_type”)] public string location_type { get; set; } [JsonProperty(“viewport”)] public Viewport viewport { get; set; } } public class Result { public List address_components { get; […]

用于C#的Google Maps API

我真的很新用于使用API​​所以在查看谷歌地图Api页面后我不确定是否有设计用于C#的API。 我不需要谷歌地图显示在我的应用程序所有我需要知道如果我可以在C#上使用谷歌地图API。 这是我想要使用的那个 我在很多地方寻找它,但我能找到的只是使用Gmaps的替代品,但那不是我想要的。 ¿有可能使用它吗?

使用Json.Net解析google map geocode json对对象的响应

我有一个充满地址的数据库,我需要得到lat和long,所以我想循环遍历它们并使用Google Geocode来更新我的数据库。 我被困在如何解析JSOn结果以获得我需要的东西: var address = “http://maps.google.com/maps/api/geocode/json?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&sensor=false”; var result = new System.Net.WebClient().DownloadString(address); GoogleGeoCodeResponse test = JsonConvert.DeserializeObject(result); 我以为我可以简单地构建一个快速类并使用JSON.Net来反序列化结果,它有点工作,但我想我在我的类结构上吹它: public class GoogleGeoCodeResponse { public string status { get; set; } public geometry geometry { get; set; } } public class geometry { public string location_type { get; set; } public location location { get; set; } } […]

Google地图 – ASP.Net中的简便方法?

我想要使​​用谷歌地图,并在网上看到百万种方式。 有些是javascript方法,有些是asp.net服务器组件,我已经击中并错过了运气。 使用c#和asp.net最简单,最可靠的方法是什么? 我的位置数据包括数据库中的地理编码。 我想为用户提供一种方法来查找某些位置。 从那里,我的代码将提供一个地理编码表格,谷歌地图上的标记在地图上对应于找到的条目。 用户可以看到每个条目,并且需要能够分辨哪些是返回多行。 有没有一个很好的方法来做到这一点?

地址之间的距离

有没有办法让谷歌地图计算出2个地址之间的距离? 怎么样?