开放街道地图(osmdroid)显示灰瓦不是PC地图 [英] open street maps (osmdroid) shows grey tiles not map in PC

查看:221
本文介绍了开放街道地图(osmdroid)显示灰瓦不是PC地图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用osmdroid让我的应用程序打开的街道地图。我曾与需要的jar文件(osmdroid)建立我的项目,并添加所需的所有权限清单。但是,当我尝试调试我在Android模拟器的应用程序(ADT的Eclipse)我不能看地图,只有青瓦。 我的项目是工作的罚款,因为如果我在调试一个智能手机,我能看到地图上,这个问题只与模拟器。

我做了一些研究,但我只找到了谷歌地图解决方案的信息,但不开放街道地图(osmdroid)。 是否有人知道如何解决这个问题呢?

这是我如何表现在XML文件中的图

 < org.osmdroid.views.MapView
        机器人:ID =@ + ID /图形页面
        机器人:layout_width =FILL_PARENT
        机器人:layout_height =322dp
        机器人:layout_alignParentLeft =真
        机器人:layout_alignParentRight =真正的>

        < /org.osmdroid.views.MapView>
 

这是我的主要活动

 图形页面=(图形页面)findViewById(R.id.mapView);
    mapView.setTileSource(TileSourceFactory.MAPQUESTOSM);
    mapView.setBuiltInZoomControls(真正的);
    mapView.setMultiTouchControls(真正的);
    mapView.setUseDataConnection(真正的);
 

这些都是体现我的权限:

 <使用-权限的Andr​​oid:名称=android.permission.ACCESS_COARSE_LOCATION/>
<使用-权限的Andr​​oid:名称=android.permission.ACCESS_FINE_LOCATION/>
<使用-权限的Andr​​oid:名称=android.permission.ACCESS_WIFI_STATE/>
<使用-权限的Andr​​oid:名称=android.permission.ACCESS_NETWORK_STATE/>
<使用-权限的Andr​​oid:名称=android.permission.INTERNET对/>
<使用-权限的Andr​​oid:名称=android.permission.WRITE_EXTERNAL_STORAG​​E/>
<使用-权限的Andr​​oid:名称=android.permission.INTERNET对>
 

和添加到我的构建路径罐子

  osmdroid-Android的4.2.jar
osmdroid-THRID方,4-2.jar
SLF4J-1.7.7.jar
 

解决方案

我创建了SD卡的模拟器,并解决了这个问题。

I am using osmdroid to get open Street maps in my app. I had build my project with the needed jars (osmdroid) and added all needed permissions in the manifest. But when I try to debug my app in android emulator (adt eclipse) I am not able to see the map, only grey tiles. 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). Does somebody know how to solve this issue?

this is how I show the map in xml file

<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

解决方案

I created an emulator with SD card and that solved the problem

这篇关于开放街道地图(osmdroid)显示灰瓦不是PC地图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆