gpt4 book ai didi

javascript - Ionic 3 谷歌地图集成

转载 作者:行者123 更新时间:2023-11-29 11:02:35 26 4
gpt4 key购买 nike

我完全按照本教程进行操作:https://www.djamware.com/post/58f4da2080aca7414e78a638/step-by-step-tutorial-of-ionic-3-angular-4-and-google-maps-directions-service

但我无法让它工作。我的 API key 设置没问题,但由于某种原因,我不断收到错误 Error: Uncaught (in promise): ReferenceError: google is not defined
ReferenceError: google 未定义

我正在使用 ionic lab 运行应用程序

出于某种原因,它无法正常工作。有人可以帮我找到问题吗?我尝试添加 cordova 白名单插件,将 API key 部分的 https 更改为 http,但仍然无法正常工作。

最佳答案

你是否在 home.ts 中声明了变量?

import { Component, ViewChild, ElementRef } from '@angular/core';
import { IonicPage } from 'ionic-angular';
import { NavController } from 'ionic-angular';

declare var google;

@IonicPage()
@Component({
selector: 'page-home',
templateUrl: 'home.html'
})
...

关于javascript - Ionic 3 谷歌地图集成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44507264/

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