【发布时间】:2018-02-26 02:47:51
【问题描述】:
在我尝试在我的项目中使用 google 变量后,我在 ionic 3 应用程序中遇到了这个错误,谁能帮我解决这个错误,
npm install --save @types/google-maps
在我的 package.json 中添加了以下内容:
"@types/google-maps": "^3.2.0",
我也确实声明了 declare var google;
然后typings install dt~google.maps --global
然后我看到了这个灵魂并尝试了它,但也没有用(注意我生成了一个 ios 密钥和 android 密钥) 试过这个 Cannot find namespace 'google'
离子科尔多瓦插件添加 https://github.com/mapsplugin/cordova-plugin-googlemaps#multiple_maps --variable API_KEY_FOR_ANDROID="YOUR_ANDROID_API_KEY_IS_HERE" --variable API_KEY_FOR_IOS="YOUR_IOS_API_KEY_IS_HERE" $ npm install --save @ionic-native/google-maps
我的 map.ts 的要点就是拍摄这个错误:
https://gist.github.com/abdulfatah-ah1407281/25bc95352d0b1ba8e02b7d1e55cc7779
运行 ionic serve 时出错:
Cannot find namespace 'google'.
C:/Users/pkhon/Desktop/k/ItBroken/src/components/map/map.ts
private map: google.maps.Map;
public isMapIdle:boolean;
【问题讨论】:
标签: typescript ionic-framework ionic2 ionic3