gpt4 book ai didi

google-maps - Ember : Use Google Maps-API in Ember

转载 作者:行者123 更新时间:2023-12-04 16:04:28 25 4
gpt4 key购买 nike

只有一两个关于如何在 ember-cli 中使用 gmaps-API 的教程。

看这个: http://blog.atmartin.io/google-maps-integration-ember-cli-edition/

不幸的是,使用这种方法几天后出现了问题。当启动我的应用程序时,gmaps-api 中似乎没有任何反应。当再次下载 JS 文件时,如教程中所述( curl -o vendor/gmaps.js https://maps.googleapis.com/maps/api/js?key=YOUR-KEY-HERE )从上面看,它又可以工作了。

  1. 怎么可能?

我还想知道谷歌本身的一般方法中的异步标签。 GMaps 团队展示了使用 GMap 的示例,如下所示:

<script async defer
src="https://maps.googleapis.com/maps/api/js?key=YOUR-KEY-HERE&callback=initMap">
</script>

  • 如上面教程中所述,通过 Brocfile.js 将 API 作为下载文件加载是否有区别(可能不是异步)?
  • 最佳答案

    如果您尝试在 ember 应用程序中使用谷歌地图 API,我强烈推荐此插件:

    http://emberobserver.com/addons/ember-google-map

    它工作得很好,您还可以在这里找到演示:http://huafu.github.io/ember-google-map/

    这是维基:https://github.com/huafu/ember-google-map/wiki

    您可以通过以下方式将其安装为插件:

    ember install ember-google-map 

    关于google-maps - Ember : Use Google Maps-API in Ember,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32485626/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com