简体   繁体   English

离子图模板仅在浏览器中有效

[英]ionic maps template only works in browser

just created a ionic project with the maps template ( https://github.com/driftyco/ionic-starter-maps ) with the command: 刚刚使用以下命令使用maps模板( https://github.com/driftyco/ionic-starter-maps )创建了一个离子项目:

ionic start MyMap maps

When running the project in the browser: 在浏览器中运行项目时:

ionic serve

Google maps map shows perfect. Google Maps地图显示完美。 However, if I try to run it in the emulator or device: 但是,如果我尝试在模拟器或设备中运行它:

ionic platform add android
ionic run android // or
ionic run emulate

Google maps simply won't load. Google地图根本无法加载。 I get a blank screen with header and footer. 我得到一个空白页眉和页脚。 Am I missing something? 我想念什么吗? I did not change a single line of code of the project after creating it with the template. 使用模板创建项目后,我没有更改项目的一行代码。

I'm facing the same issues as you. 我面临着与您相同的问题。 Removing the following line of code helps. 删除以下代码行会有所帮助。

<meta http-equiv="Content-Security-Policy" content="default-src *;
style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline'
'unsafe-eval'">

Seems like some security feature, I'm not sure if that line is very important, do it at your own risk. 似乎有些安全功能,我不确定那条线是否非常重要,请您自担风险。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 离子模板缓存仅在浏览器中无法在设备上使用 - Ionic template cache doesn't work on device, only in browser 谷歌地图只适用于wifi? - google maps works only on wifi? 离子白名单插件阻止了iPhone,但可以在浏览器中使用 - Ionic whitelist plugin blocks the iPhone but works in the browser 离子$ location.path()可在浏览器中使用,但不能在设备上使用 - Ionic $location.path() works in browser but not on devices ionic \\ cordova jsonp可在浏览器中使用,但不适用于ANDROID - ionic\cordova jsonp works in browser but not on ANDROID Ionic View Google登录弹出窗口在Firebase 2中有效,但在Firebase 3中无效(在浏览器中有效) - Ionic View Google Login Popup works in Firebase 2, but not in Firebase 3 (works in browser) 离子模拟ios仅适用于--livereload - Ionic emulate ios only works with --livereload 离子Android推送通知仅在后台工作 - Ionic android push notification works only in background LocationService ionic google-maps 对象无法用于 ios,但适用于 android - LocationService ionic google-maps object failing for ios, but works in android 只有 1 个 onClickListener 适用于谷歌地图活动中的标记 - Only 1 onClickListener works on markers in google maps activity
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM