admin管理员组文章数量:1332389
I'm embedding a map in a webpage but I keep getting a ApiNotActivatedMapError for some reason, I'm looking at it and it is activated. I'm just at a loss here.
<div id="map" style="width:100%;height:400px">My map will go here</div>
<script>
// Initialize and add the map
function initMap() {
var mapProp= {
center:new google.maps.LatLng(51.508742,-0.120850),
zoom:5,
};
var map=new google.maps.Map(document.getElementById("map"),mapProp);
}
</script>
<script async defer
src=";callback=initMap">
</script>
Does anybody have any experience with this problem? Am I missing something simple? Thanks
I'm embedding a map in a webpage but I keep getting a ApiNotActivatedMapError for some reason, I'm looking at it and it is activated. I'm just at a loss here.
<div id="map" style="width:100%;height:400px">My map will go here</div>
<script>
// Initialize and add the map
function initMap() {
var mapProp= {
center:new google.maps.LatLng(51.508742,-0.120850),
zoom:5,
};
var map=new google.maps.Map(document.getElementById("map"),mapProp);
}
</script>
<script async defer
src="https://maps.googleapis./maps/api/js?key=MY_API_KEY&callback=initMap">
</script>
Does anybody have any experience with this problem? Am I missing something simple? Thanks
Share edited Jul 12, 2018 at 13:52 xomena 32.2k6 gold badges96 silver badges125 bronze badges asked Jul 10, 2018 at 21:14 MattWolc24MattWolc24 1061 silver badge9 bronze badges 1- Which API did you activate in your project? The code that you posted requires a Google Maps JavaScript API be activated. – xomena Commented Jul 12, 2018 at 13:53
1 Answer
Reset to default 9Go to console.cloud.google. and follow the following steps:
1) APIs & Services
2) Dashboard
3) + Enable APIS and Services
4) Maps JavaScript API
5) hit Enable button
本文标签:
版权声明:本文标题:javascript - Getting ApiNotActivatedMapError when trying to use embed map API despite the API being activated - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742266842a2443561.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论