尝试访问Google Maps API时“找不到名称'google'”

时间:2019-01-29 18:08:40

标签: angular typescript google-maps ionic-framework

我正在做本教程on Google Maps into Ionic,我做了所有事情,修正了其他错误,但出现了这个错误:

  

[14:33:14]开始进行转译...   [14:33:27]打字稿:... ncisco / ionic / ionic / ionic-google-maps-example / src / components / google-maps / google-maps.ts,第157行              找不到名称“ google”。

     

L157:让latLng = new google.maps.LatLng(position.coords.latitude,   position.coords.longitude);

     

[14:33:27]打字稿:   ... ncisco / ionic / ionic-ionic-google-maps-example / src / components / google-maps / google-maps.ts,   线:164   找不到名称“ google”。

     

L164:this.map =新的google.maps.Map(this.element.nativeElement,mapOptions);        L165:resolve(true);

我遵循了教程中的建议并运行:

  

npm install @ types / googlemaps --save-dev

但是,它没有任何改变。我看过另一篇文章,建议运行带有类型的命令来安装它,但仍然看不到它。

0 个答案:

没有答案