Geocoder模块编写
2015-06-20 15:38
295 查看
Geocoder模块
Geocoder模块的主要工作流程是:
组装GeocoderRequest对象
发送Geocoder请求,并设置回调函数(调用geocode)
检查返回的GeocoderStatus,如果成功则调用相应的方法展示GeocoderResult
GeocoderResult的结构:
address_components:存储各级地址信息直至国家级
formatted_address:完整格式的地址字符串
geometry:地理信息,包括经纬度、视窗、地址类型
types:地址的类型
免费会员网
例子:
Geocoder模块的主要工作流程是:
组装GeocoderRequest对象
发送Geocoder请求,并设置回调函数(调用geocode)
检查返回的GeocoderStatus,如果成功则调用相应的方法展示GeocoderResult
GeocoderResult的结构:
address_components:存储各级地址信息直至国家级
formatted_address:完整格式的地址字符串
geometry:地理信息,包括经纬度、视窗、地址类型
types:地址的类型
免费会员网
例子:
{ "results" : [ { "address_components" : [ { "long_name" : "深圳", "short_name" : "深圳", "types" : [ "locality", "political" ] }, { "long_name" : "广东省", "short_name" : "广东省", "types" : [ "administrative_area_level_1", "political" ] }, { "long_name" : "中国", "short_name" : "CN", "types" : [ "country", "political" ] } ], "formatted_address" : "中国广东省深圳", "geometry" : { "bounds" : { "northeast" : { "lat" : 22.86174840, "lng" : 114.62698980 }, "southwest" : { "lat" : 22.44588410, "lng" : 113.75319730 } }, "location" : { "lat" : 22.5430990, "lng" : 114.0578680 }, "location_type" : "APPROXIMATE", "viewport" : { "northeast" : { "lat" : 22.78093130, "lng" : 114.35531620 }, "southwest" : { "lat" : 22.32938930, "lng" : 113.75244140 } } }, "types" : [ "locality", "political" ] } ], "status" : "OK" }
相关文章推荐
- C#.NET彩票数据分析
- C++ typeid操作符
- e学编程之《设计模式》篇-状态模式
- c++隐藏文件
- C++间接继承
- C++虚基类
- 【Code】时间戳转换天时分秒字符串
- 欢迎使用CSDN-markdown编辑器
- Lua 与C/C++ 交互系列: Lua调用C/C++函数(2).
- SoapUI测试WebService
- view
- iptables之基础知识
- poj 3080 Blue Jeans
- bzoj4042
- 帝国cms循环子栏目导航
- VS2013 Qt Unable to find a Qt Build 及 LINK1112错误
- Matlab和C混合编程举例
- 渗透测试方向概览
- TextView
- Deutsch lernen (04)