【发布时间】:2016-02-11 18:29:38
【问题描述】:
我正在实施一项 Google Place 服务。当我检索到 json 对象时,我意识到 json 对象(opening_hours)中缺少数组。下面是检索到的对象的示例。有谁知道为什么缺少某些字段?
Hi, i referred to your answers and find a place which has opening hours in google maps but still does not exist in the json object. Below is the example.
[{
"html_attributions": \[
"Listings by <a href=\"http://www.openrice.com/\">OpenRice</a>"
\],
"results": \[
{
"formatted_address": "30 Raffles Ave, Singapore 039803",
"geometry": {
"location": {
"lat": 1.2892988,
"lng": 103.8631368
}
},
"icon": "https://maps.gstatic.com/mapfiles/place_api/icons/generic_business-71.png",
"id": "021245e36680793a72b3c428607f0a01ed5d1786",
"name": "Singapore Flyer",
"opening_hours": {
"open_now": true,
"weekday_text": \[\]
},
"photos": \[
{
"height": 2048,
"html_attributions": \[
"<a href=\"https://maps.google.com/maps/contrib/115338279981022433314/photos\">David Montasco</a>"
\],
"photo_reference": "CmRdAAAAWbq-OmrKkZ0Rz9JyDVrnnMjD760XaCdEPBOYLITUhfUCcr6N4YmsMUxyou5yWnMQs4_iQhQc04cR4WOrDuqR5a43ZaH5O5zv4O783lXZP4qDosm-bnUUmyCOV7pNH76LEhBgl4L5ScAvva4b4TkM7-UGGhTmUVujviiDHGICoITSZr5JKJFgQA",
"width": 1367
}
\],
"place_id": "ChIJzVHFNqkZ2jERboLN2YrltH8",
"rating": 4.3,
"reference": "CnRiAAAACBop0imOgmYxPrAp_4b6CIgkGMeaaWb6oL-RsoOK6CxElf7-yNPBz_q5qXVpTfVpsmtWDua6r7gEZdsi9420icrp-mnpG6HLiGmmHupluWkUmuRCdwQ8BRlPW_HYAP9qEblbZMoAbvBDGMZgk_QyoRIQtPeJRN6-_Nm66jH-OMsCBBoUkZDaSDMQqEyPpCOyysU6ulgZtA8",
"types": \[
"establishment"
\]
}
\],
"status": "OK"
}][1]
【问题讨论】:
-
我会验证您从 google 获取的内容,并确保它没有嵌套在对象内。希望这会有所帮助。
-
The documentation 表示结果可能包含以下字段(包括opening_hours。您为什么希望它存在?
-
您可以添加获取此数据的请求吗?我相信只有在谷歌注册的企业才会有opening_hours数据。 IE。如果我搜索我的房子,它不会有 opening_hours,但如果我搜索我附近的银行,它会。您在寻找在 Google 注册的企业吗?
标签: json google-maps google-places-api missing-data google-places