google static map api works on host only after localhost

女生的网名这么多〃 提交于 2020-01-03 05:50:08

问题


i have Simple API Access key for my website..
I have set Referers:www.mysite.com and www.mysite.com/*..
i am using static map api in my website.ex: https://maps.google.com/staticmap?markers=11.6879216,92.7241781&size=300x300&key=mykey&sensor=false. .
when i am trying to access in page i got this message..
"The Google Maps API server rejected your request. This site or IP is not authorized to use this API key.".
But if load the same page with same api key in localhost using wamserver, it shows the map. .
After that it shows the map in website also if i load again.
why is it happening like this?.
can anyone solve my problem.
thanks in advance


回答1:


Just confirm that you are putting the URL into the src tag of an IMG element?

Make sure you have enabled the static API for your personal key on the API console page: https://code.google.com/apis/console/



来源:https://stackoverflow.com/questions/19740237/google-static-map-api-works-on-host-only-after-localhost

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