Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
4.2k views
in Technique[技术] by (71.8m points)

高德地图返回值类型不相同

  • 高德地图请求: //restapi.amap.com/v3/geocode/regeo?key=您的key&location=116.481488,39.990464&poitype=商务写字楼&radius=1000&extensions=all&batch=false&roadlevel=0 返回如下.

这里的tel 两个属性类型不同 如何转换成java对象.

 {
            "id": "B000A84MIB",
            "name": "方恒国际中心A座",
            "type": "商务住宅;楼宇;商务写字楼",
            "tel": "010-84107066",
            "direction": "西南",
            "distance": "120.132",
            "location": "116.480826,39.989510",
            "address": "望京阜通东大街6号院",
            "poiweight": "0.580199",
            "businessarea": "望京"
        }, {
            "id": "B000A7Z1ZD",
            "name": "万科时代中心A座(望京小街)",
            "type": "商务住宅;楼宇;商务写字楼",
            "tel": [],
            "direction": "东",
            "distance": "183.978",
            "location": "116.483639,39.990316",
            "address": "望京街9号",
            "poiweight": "0.546825",
            "businessarea": "望京"
        },

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

我觉得可以先部分转换,针对 tel 单个处理吧,最好看看高德的文档说明。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...