Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/208.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Can';无法在自己的测试应用程序上显示覆盖图_Java_Android_Osmdroid - Fatal编程技术网

Java Can';无法在自己的测试应用程序上显示覆盖图

Java Can';无法在自己的测试应用程序上显示覆盖图,java,android,osmdroid,Java,Android,Osmdroid,编辑:这很尴尬,MKer是对的,我更正了代码,现在可以看到比例尺了。我的位置问题还并没有解决 我已经试了几天了,我开始拉扯我的头发。Android和Osmdroid的Noob 我可以构建并且已经成功地实现了osmdroid演示应用程序。还尝试了OSMbonuspack,让导航器使用“FindMe”覆盖、缩放等 问题是,每当我制作自己的应用程序时,地图上唯一显示并起作用的叠加就是指南针。我想我做错了什么,但是找不到关于这个主题的任何信息 我已经用Genymotion虚拟设备(甚至连指南针秀都没有)

编辑:这很尴尬,MKer是对的,我更正了代码,现在可以看到比例尺了。我的位置问题还并没有解决

我已经试了几天了,我开始拉扯我的头发。Android和Osmdroid的Noob

我可以构建并且已经成功地实现了osmdroid演示应用程序。还尝试了OSMbonuspack,让导航器使用“FindMe”覆盖、缩放等

问题是,每当我制作自己的应用程序时,地图上唯一显示并起作用的叠加就是指南针。我想我做错了什么,但是找不到关于这个主题的任何信息

我已经用Genymotion虚拟设备(甚至连指南针秀都没有)和我的6.0手机进行了测试,指南针可以工作,但没有我的位置甚至刻度

我已经给了应用程序权限,我在android日志中看到的都是关于移动地图时加载瓷砖的消息。再加上这个错误,除了中文,我没有找到太多关于它的信息

E/IzatSvc_被动客户端:E/退出时出错虚拟无效izat_管理器::IzatPassiveLocationListener::onLocationChanged(const izat_管理器::IzatLocation*,izat_管理器::IzatLocationStatus)第113行“1”

欢迎任何帮助

这是我的manifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.anemptyappmap">

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>
布局呢

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.example.anemptyappmap.MainActivity">

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/crossfade_content"
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        <org.osmdroid.views.MapView android:id="@+id/mMapView"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />
    </LinearLayout>

</android.support.constraint.ConstraintLayout>


您看不到比例尺,因为您没有将其添加到地图覆盖图中(就像对Compass所做的那样)。关于我的位置,我不知道。非常感谢!我想我已经检查过了,但现在我可以看到比例尺了。已相应地编辑了代码。仍然没有位置覆盖的运气!只是一个更新,我无法在手机上显示位置覆盖,但在Genymotion 4.4设备上显示良好。所以我猜这是一些奇怪的事情。我所做的是使用MKer的OSMDROIDBONSPACK库,按照他的示例应用程序,我已经能够在任何设备上获得位置。你看不到比例尺,因为你没有将它添加到地图覆盖图中(就像你在Compass中所做的那样)。关于我的位置,我不知道。非常感谢!我想我已经检查过了,但现在我可以看到比例尺了。已相应地编辑了代码。仍然没有位置覆盖的运气!只是一个更新,我无法在手机上显示位置覆盖,但在Genymotion 4.4设备上显示良好。所以我猜这是一些奇怪的事情。我所做的是使用MKer的OSMDROIDBONSPACK库,按照他的示例应用程序,我已经能够在任何设备上使用该位置。
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.example.anemptyappmap.MainActivity">

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/crossfade_content"
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        <org.osmdroid.views.MapView android:id="@+id/mMapView"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />
    </LinearLayout>

</android.support.constraint.ConstraintLayout>