admin管理员组文章数量:1394228
I am trying to migrate from v2 to v3 in google maps API and I keep getting this error: The Google Maps API server rejected your request. The "sensor" parameter specified in the request must be set to either "true" or "false".
Here is the tutorial I am using:
In the javascript I have changed src to
<script type="text/javascript"
src=";sensor=TRUE">
</script>
but I keep getting the following error: The Google Maps API server rejected your request. The "sensor" parameter specified in the request must be set to either "true" or "false".
What does the error mean and how can I fix it?
I am trying to migrate from v2 to v3 in google maps API and I keep getting this error: The Google Maps API server rejected your request. The "sensor" parameter specified in the request must be set to either "true" or "false".
Here is the tutorial I am using: https://developers.google./maps/documentation/javascript/tutorial
In the javascript I have changed src to
<script type="text/javascript"
src="http://maps.googleapis./maps/api/js?key=AIzaSyDzGdafsdfdfgoO4cHbfRGL8W23dgfafJKnA&sensor=TRUE">
</script>
but I keep getting the following error: The Google Maps API server rejected your request. The "sensor" parameter specified in the request must be set to either "true" or "false".
What does the error mean and how can I fix it?
Share Improve this question asked Mar 31, 2012 at 19:43 StagletonStagleton 1,0603 gold badges13 silver badges35 bronze badges4 Answers
Reset to default 4Use: sensor=true
instead of sensor=TRUE
It is case-sensitive.
In case anyone else is having a similar issue, I also got this error for a different reason.
In my case, the problem had to do with an extra line break and spaces that were inserted in the code when I copied and pasted an example from Google's website.
This line was the problem:
<script type="text/javascript" src="https://maps.googleapis./maps/api/js?key=YOUR_KEY_HERE&sensor=false">
Make sure to squeeze everything right together, nice and neat, or it won't parse the code correctly.
Ran into the same problem. If you already have the right key and all lowercase for the sensor boolean, make sure you have specified your map dimensions. For example, from the tutorial:
<style type="text/css">
html { height: 100% }
body { height: 100%; margin: 0; padding: 0 }
#map-canvas { height: 100% }
</style>
Make in this manner. Please check there is no space between ?and sensor.
本文标签: javascriptWhy do I keep getting the error trying to load googlemapsStack Overflow
版权声明:本文标题:javascript - Why do I keep getting the error trying to load googlemaps? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744633273a2616671.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论