首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用Google Maps API的应用程序构建错误

使用Google Maps API的应用程序构建错误
EN

Stack Overflow用户
提问于 2012-12-10 04:15:53
回答 2查看 2.2K关注 0票数 3

我有一个问题为生产构建我的sencha touch 2应用程序,使用这个命令:"sencha app build production“。我看到以下问题:

代码语言:javascript
复制
C:\xampp\htdocs\eiamobile\eiamobile\i>sencha app build production
[INFO] Deploying your application to C:\xampp\htdocs\eiamobile\eiamobile\i\build\production
[INFO] Copied sdk/sencha-touch.js
[INFO] Copied app.js
[ERROR] UNKNOWN, unknown error 'C:\xampp\htdocs\eiamobile\eiamobile\i\build\production\http:'

我看到只有当我在app.json文件中使用外部JS (谷歌几何)文件时:

代码语言:javascript
复制
  "js": [
    {
        "path": "sdk/sencha-touch.js"
    },
    {
        "path": "app.js",
        "bundle": true,  /* Indicates that all class dependencies are concatenated into this file when build */
        "update": "delta"
    },
    {
        "path": "http://maps.google.com/maps/api/js?sensor=false&v=3&libraries=geometry",
        "bundle": true,  /* Indicates that all class dependencies are concatenated into this file when build */
        "update": "delta"
    }

]

任何帮助我们都将不胜感激。

编辑:

添加我的index.html文件

代码语言:javascript
复制
 <html manifest="" lang="en-US">
 <head>
 <meta charset="UTF-8">
 <title>eia-sencha</title>
 <style type="text/css">
     /**
     * Example of an initial loading indicator.
     * It is recommended to keep this as minimal as possible to provide instant feedback
     * while other resources are still being loaded for the first time
     */
    html, body {
        height: 100%;
        background-color: #1985D0
    }

    #appLoadingIndicator {
        position: absolute;
        top: 50%;
        margin-top: -15px;
        text-align: center;
        width: 100%;
        height: 30px;
        -webkit-animation-name: appLoadingIndicator;
        -webkit-animation-duration: 0.5s;
        -webkit-animation-iteration-count: infinite;
        -webkit-animation-direction: linear;
    }

    #appLoadingIndicator > * {
        background-color: #FFFFFF;
        display: inline-block;
        height: 30px;
        -webkit-border-radius: 15px;
        margin: 0 5px;
        width: 30px;
        opacity: 0.8;
    }

    @-webkit-keyframes appLoadingIndicator{
        0% {
            opacity: 0.8
        }
        50% {
            opacity: 0
        }
        100% {
            opacity: 0.8
        }
    }
 </style>
 <!-- The line below must be kept intact for Sencha Command to build your application -->
<script id="microloader" type="text/javascript" src="sdk/microloader/development.js"></script>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&v=3&libraries=geometry"></script>

 </head>
 <body>
   <div id="appLoadingIndicator">
    <div></div>
    <div></div>
    <div></div>
   </div>
 </body>
 </html>
EN

回答 2

Stack Overflow用户

发布于 2012-12-10 04:33:20

尝试在app.json中添加"remote": true

http://mitchellsimoens.com/2012/07/sencha-touch-2/going-remote-with-sencha-command/

票数 2
EN

Stack Overflow用户

发布于 2012-12-10 05:00:16

From Sencha Touch documentation

要使用此组件,您必须包含来自谷歌的附加JavaScript文件:

代码语言:javascript
复制
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>

因此,我猜您可以尝试以这种方式加载API,这实际上是他们在框架附带的map示例中所做的。

另外,如果你的应用程序启动时google是未定义的,我想你可以异步加载GM API:

http://www.senchafiddle.com/#MhAME

希望这能有所帮助

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/13791364

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档