url 是否需要在 google maps/direction api 中对 placeID 进行编码?

Is it necessary to url encode placeIDs in google maps/direction api?

从我目前看到的所有placeID来看,似乎没有必要。所以只要确保。

是的,已经没有必要了。据我所知, placeIDs 不包含空格, ASCII set and any reserved ASCII characters, so convertion or URL Encoding 之外的字符也不是必需的加密.

A place ID is a textual identifier that uniquely identifies a place. The length of the identifier may vary. Examples:

  • ChIJrTLr-GyuEmsRBfy61i59si0
  • EisxMyBNYXJrZXQgU3RyZWV0LCBXaWxtaW5ndG9uLCBOQyAyODQwMSwgVVNB

您还可以保存地点 ID 以备后用。地点 ID 不受 Section 10.5.d of the Google Maps APIs Terms of Service. You can therefore store place ID values for later use. Just refresh your stored place IDs periodically, after 100 days to avoid NOT_FOUND status code. To learn more about Place IDs, you can check Google Places API Place IDs.

中规定的缓存限制

希望对您有所帮助。