Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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
like image 734
Dany19 Avatar asked Jul 09 '14 13:07

Dany19


People also ask

How do I fix OpenStreetMap?

If you just want to edit as soon as possible, visit https://www.openstreetmap.org, zoom to an area, and click "edit". (You'll need an account first). The default editor has a built-in guide that will explain the basics. You can also click the built-in "help" button at any time.

Can I use OpenStreetMap tiles?

Can I use your map tiles? We are in principle happy for our map tiles to be used by external users for creative and unexpected uses - in contrast to most web mapping providers. However, the OpenStreetMap servers are run entirely on donated resources.

What maps use OpenStreetMap?

There are many specialized online-maps which use OpenStreetMap as data source. Some examples: Bicycle map OpenCycleMap.org. Wheelchair user map Wheelmap.org.


1 Answers

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

like image 171
Dany19 Avatar answered Oct 02 '22 22:10

Dany19