[英]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.