Does google map in china api not support key?

不想你离开。 提交于 2019-12-12 03:47:40

问题


I've tried to get city information for china users

http://maps.google.cn/maps/api/geocode/json?latlng=39.934574,116.342378&key=MyAPI

It wasn't worked

http://maps.google.cn/maps/api/geocode/json?latlng=39.934574,116.342378

I removed key and try again

works fine

MyAPI key don't need anymore in china? If so Why google request to set API key in other country? And why not request in china?

How I set my API Key to get city information in china

just remove my key?


回答1:


The first request with an API key didn't work, because a Server API key requires https protocol. Unfortunately, maps.google.cn domain does not support https [1].

[1] https://developers.google.com/maps/faq#china_ws_access

Web Service request without an API key apparently supports http protocol, so you can get results.

The difference between request with API key and request without an API key consists in how Google calculates your usage.

When you apply API key your usage is calculated against the developer console project. When you don't apply API key your usage is calculated against IP address. You have 2500 daily requests, but if you share the same IP address with somebody else, you will be unable to use all 2500 daily requests. That's why an API key is recommended.

In your case requests without an API key might be a workaround, but you cannot be sure that your daily usage will reach 2500.



来源:https://stackoverflow.com/questions/37694099/does-google-map-in-china-api-not-support-key

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!