Titanium 在Tianium的Appcelerator中仅显示网格但不显示地图的地图视图

Titanium 在Tianium的Appcelerator中仅显示网格但不显示地图的地图视图,titanium,appcelerator,appcelerator-mobile,Titanium,Appcelerator,Appcelerator Mobile,我正在使用Titanium的Appcelerator开发一个基于地图的应用程序。我面临的问题是,当我在Android设备上模拟应用程序时,我可以看到mapview的网格,但没有显示地图。我已经将ti.android.google.map.api.key放在tiapp.xml文件中,并且还设置了所有特定于android清单的权限。我的源代码是: tiapp.xml: 首先,检查您的Android仿真器/设备是否与InterNet连接 如果网络正常工作,那么它运行正常 有关更多详细信息或演示代码,请

我正在使用Titanium的Appcelerator开发一个基于地图的应用程序。我面临的问题是,当我在Android设备上模拟应用程序时,我可以看到mapview的网格,但没有显示地图。我已经将ti.android.google.map.api.key放在tiapp.xml文件中,并且还设置了所有特定于android清单的权限。我的源代码是:

tiapp.xml:
首先,检查您的Android仿真器/设备是否与InterNet连接

如果网络正常工作,那么它运行正常

有关更多详细信息或演示代码,请参见此。 tiapp.xml

<?xml version="1.0" encoding="UTF-8"?>
<ti:app xmlns:ti="http://ti.appcelerator.org">
    <deployment-targets>
        <target device="mobileweb">false</target>
        <target device="iphone">false</target>
        <target device="ipad">false</target>
        <target device="android">true</target>
        <target device="blackberry">false</target>
    </deployment-targets>
    <id>com.maps</id>
    <name>maps</name>
    <version>1.0</version>
    <publisher>tlukasavage</publisher>
    <url></url>
    <description>not specified</description>
    <copyright>2011 by tlukasavage</copyright>
    <icon>appicon.png</icon>
    <persistent-wifi>false</persistent-wifi>
    <prerendered-icon>false</prerendered-icon>
    <statusbar-style>default</statusbar-style>
    <statusbar-hidden>false</statusbar-hidden>
    <fullscreen>false</fullscreen>
    <navbar-hidden>false</navbar-hidden>
    <analytics>true</analytics>
    <guid>YOUR_GUID</guid>
    <iphone>
        <orientations device="iphone">
            <orientation>Ti.UI.PORTRAIT</orientation>
        </orientations>
        <orientations device="ipad">
            <orientation>Ti.UI.PORTRAIT</orientation>
            <orientation>Ti.UI.UPSIDE_PORTRAIT</orientation>
            <orientation>Ti.UI.LANDSCAPE_LEFT</orientation>
            <orientation>Ti.UI.LANDSCAPE_RIGHT</orientation>
        </orientations>
    </iphone>
    <android xmlns:android="http://schemas.android.com/apk/res/android"/>
    <modules/>

    <!-- Here's where we add the API key -->
    <property name="ti.android.google.map.api.key">YOUR_ANDROID_MAPS_API_KEY</property>
</ti:app>

试试这个,这对你真的很有帮助。。。干杯。

首先,检查您的Android仿真器/设备是否与InterNet连接

如果网络正常工作,那么它运行正常

有关更多详细信息或演示代码,请参见此。 tiapp.xml

<?xml version="1.0" encoding="UTF-8"?>
<ti:app xmlns:ti="http://ti.appcelerator.org">
    <deployment-targets>
        <target device="mobileweb">false</target>
        <target device="iphone">false</target>
        <target device="ipad">false</target>
        <target device="android">true</target>
        <target device="blackberry">false</target>
    </deployment-targets>
    <id>com.maps</id>
    <name>maps</name>
    <version>1.0</version>
    <publisher>tlukasavage</publisher>
    <url></url>
    <description>not specified</description>
    <copyright>2011 by tlukasavage</copyright>
    <icon>appicon.png</icon>
    <persistent-wifi>false</persistent-wifi>
    <prerendered-icon>false</prerendered-icon>
    <statusbar-style>default</statusbar-style>
    <statusbar-hidden>false</statusbar-hidden>
    <fullscreen>false</fullscreen>
    <navbar-hidden>false</navbar-hidden>
    <analytics>true</analytics>
    <guid>YOUR_GUID</guid>
    <iphone>
        <orientations device="iphone">
            <orientation>Ti.UI.PORTRAIT</orientation>
        </orientations>
        <orientations device="ipad">
            <orientation>Ti.UI.PORTRAIT</orientation>
            <orientation>Ti.UI.UPSIDE_PORTRAIT</orientation>
            <orientation>Ti.UI.LANDSCAPE_LEFT</orientation>
            <orientation>Ti.UI.LANDSCAPE_RIGHT</orientation>
        </orientations>
    </iphone>
    <android xmlns:android="http://schemas.android.com/apk/res/android"/>
    <modules/>

    <!-- Here's where we add the API key -->
    <property name="ti.android.google.map.api.key">YOUR_ANDROID_MAPS_API_KEY</property>
</ti:app>

试试这个,这对你真的很有帮助。。。干杯。

我也有同样的问题,并且设备已连接到Internet,可以在设备中浏览

我通过在清单中添加互联网权限解决了这个问题

<uses-permission android:name="android.permission.INTERNET"/>
我不知道这是不是正确的解决方案,但这为我解决了问题


无论如何,试试看。

我也遇到了同样的问题,而且设备已连接到Internet,可以在设备中浏览

我通过在清单中添加互联网权限解决了这个问题

<uses-permission android:name="android.permission.INTERNET"/>
我不知道这是不是正确的解决方案,但这为我解决了问题


无论如何,试一试。

我也遇到过同样的问题,Android显示了一张空白地图,而iOS很好。我用的是钛合金框架

文件上说要做:

alloy.js

index.xml

由于某些原因,Android不喜欢Alloy.Globals.Map,而是更喜欢直接引用ti.Map。对index.xml的以下更改对我起到了作用:

index.xml


我也遇到过同样的问题,Android显示了一张空白地图,而iOS则很好。我用的是钛合金框架

文件上说要做:

alloy.js

index.xml

由于某些原因,Android不喜欢Alloy.Globals.Map,而是更喜欢直接引用ti.Map。对index.xml的以下更改对我起到了作用:

index.xml


路线将显示在栅格视图上。但地图仍然没有显示出来。在运行应用程序之前,我检查了设备的网络连接,一切正常。我无法理解为什么应用程序会意外运行。我是否需要为Appcelerator应用程序生成一个单独的google地图键?下面提到的代码最终对我有用。不需要在tiapp.xml文件中添加任何内容。app.js文件将显示like://create 窗口var win1=Titanium.UI.createWindow{title:'Exercise Tracker',backgroundColor:'000'}//创建我们的mapview var mapview=Titanium.Map.createView{top:110,height:350,mapType:Titanium.Map.STANDARD_类型,区域:{纬度:51.50015,经度:-0.12623,纬度德尔塔:0.5,经度德尔塔:0.5},动画:真,区域名:真,用户位置:真}//将地图添加到窗口win1.addmapview//最后,打开win1.open窗口;路线将显示在栅格视图上。但地图仍然没有显示出来。在运行应用程序之前,我检查了设备的网络连接,一切正常。我无法理解为什么应用程序会意外运行。我是否需要为Appcelerator应用程序生成一个单独的google地图键?下面提到的代码最终对我有用。不需要在tiapp.xml文件中添加任何内容。app.js文件将显示like://create 窗口var win1=Titanium.UI.createWindow{title:'Exercise Tracker',backgroundColor:'000'}//创建我们的mapview var mapview=Titanium.Map.createView{top:110,height:350,mapType:Titanium.Map.STANDARD_类型,区域:{纬度:51.50015,经度:-0.12623,纬度德尔塔:0.5,经度德尔塔:0.5},动画:真,区域名:真,用户位置:真}//将地图添加到窗口win1.addmapview//最后,打开win1.open窗口;
<uses-permission android:name="android.permission.INTERNET"/>
// Loads the map module, which can be referenced by Alloy.Globals.Map
Alloy.Globals.Map = require('ti.map');
<View id="mapview" ns="Alloy.Globals.Map" onClick="report" />
<View id="mapview" ns="Ti.Map" platform='android' onClick="report" />
<View id="mapview" ns="Alloy.Globals.Map" platform='ios' onClick="report" />