简体   繁体   English

开放街道地图(osmdroid)显示灰色瓷砖不在PC中映射

[英]open street maps (osmdroid) shows grey tiles not map in PC

I am using osmdroid to get open Street maps in my app. 我正在使用osmdroid在我的应用程序中获取开放的街道地图。 I had build my project with the needed jars (osmdroid) and added all needed permissions in the manifest. 我用所需的jar(osmdroid)构建了我的项目,并在清单中添加了所有必需的权限。 But when I try to debug my app in android emulator (adt eclipse) I am not able to see the map, only grey tiles. 但是当我尝试在Android模拟器(adt eclipse)中调试我的应用程序时,我无法看到地图,只能看到灰色瓷砖。 My project is working fine because if I debug in a smartphone I am able to see the map, the problem is only with the emulator. 我的项目工作正常,因为如果我在智能手机中调试我能够看到地图,问题只出在模拟器上。

I have done some research but I only found information of google maps solutions but not open street maps (osmdroid). 我做了一些研究,但我只找到了谷歌地图解决方案的信息,但没有找到开放的街道地图(osmdroid)。 Does somebody know how to solve this issue? 有人知道如何解决这个问题吗?

this is how I show the map in xml file 这是我在xml文件中显示地图的方式

<org.osmdroid.views.MapView
        android:id="@+id/mapView"
        android:layout_width="fill_parent"
        android:layout_height="322dp"
        android:layout_alignParentLeft="true"
        android:layout_alignParentRight="true" >

        </org.osmdroid.views.MapView>

this is my main activity 这是我的主要活动

mapView  = (MapView) findViewById(R.id.mapView);
    mapView.setTileSource(TileSourceFactory.MAPQUESTOSM);
    mapView.setBuiltInZoomControls(true);
    mapView.setMultiTouchControls(true);
    mapView.setUseDataConnection(true);

These are my permissions in manifest: 这些是我在清单中的权限:

<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.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" >

and the jars added to my build path 并将罐子添加到我的构建路径中

osmdroid-android-4.2.jar
osmdroid-thrid-party-4-2.jar
slf4j-1.7.7.jar

我用SD卡创建了一个模拟器,解决了这个问题

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM