如何在谷歌地图中提前从地址字符串中获取GLatLng对象?
我想提前在谷歌地图中获取 latlng 对象。基本上我的 json 结果是返回地址数组,我需要将其转换为 glatlng 以用于标记。但如果我将使用 GeoCoder 对象,那么它将发送我不想要的异步请求。
除了 GeoCoder 对象之外,还有其他方法可以将地址字符串转换为 GLatLng 对象吗?
I want to get latlng object in google maps in advance. Basically my json result is returning array of address which I need to convert to glatlng to use for markers. But if i will use GeoCoder object then it will send asynch request which I don't want.
Is there any way other than GeoCoder object to convert an address string to GLatLng object?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以查看任何对地图 API 的查询返回的 json 对象。
然后,您使用 system.web.extensions 中的 json 序列化器将 json 序列化为必须根据手动分析的 JSON 响应创建的类。
请注意,您可以通过将其添加到 http Web 请求来获取本地化语言返回结果:
编辑:
该示例来自我的一个文件(删除所有 SharpMap.Map 内容,它需要外部程序集。
You can take a look at the json object returned by any query to the maps api.
Then you use the json serializer in system.web.extensions to serialize the json into a class that you have to create from the JSONresponses which you analyze manually.
Note that you can get localized language return results by adding this to the http web request:
Edit:
The example, from one of my files (remove all the SharpMap.Map stuff, it requires an external assembly.