OSM android tile source

Put problem concerning MapActivities, MapViews, Overlays and GPS in this forum.

OSM android tile source

Postby noog » Mon Mar 14, 2011 6:13 pm

hello
how can i change the android tile source in OSM for android ?
i have this in the MapActivity.java
what must i add to change the tile source ? or where is the url of the default osm tiling source ?
thks
Code: Select all
      this.mOsmv = new MapView(this, 256, mResourceProxy);
      this.mLocationOverlay = new MyLocationOverlay(this.getBaseContext(), this.mOsmv,
            mResourceProxy);
      this.mOsmv.setBuiltInZoomControls(true);
      this.mOsmv.setMultiTouchControls(true);
      rl.addView(this.mOsmv, new RelativeLayout.LayoutParams(LayoutParams.FILL_PARENT,
      LayoutParams.FILL_PARENT));   
      this.setContentView(rl);
      double lat= 49.256602D;
      double lon= 4.033091D;
      point = new GeoPoint((int) (lat * 1E6), (int) (lon * 1E6));
      mOsmv.getController().setZoom(15);
      mOsmv.getController().setCenter(point);
noog
Freshman
Freshman
 
Posts: 4
Joined: Mon Mar 14, 2011 5:54 pm

Top

Re: OSM android tile source

Postby ruelblapid » Tue Mar 15, 2011 4:36 am

how can i change the android tile source in OSM for android ?


Are you referring to the application name? Sorry that's how i understand your question. :)
if yes go to res/values/strings.xml and look for the app_name.


Best,
Ruel B. Lapid
Senior Android Engineer
User avatar
ruelblapid
Experienced Developer
Experienced Developer
 
Posts: 65
Joined: Mon Mar 14, 2011 2:37 am

Re: OSM android tile source

Postby noog » Tue Mar 15, 2011 12:12 pm

ruelblapid wrote:
how can i change the android tile source in OSM for android ?


Are you referring to the application name? Sorry that's how i understand your question. :)
if yes go to res/values/strings.xml and look for the app_name.


Best,


No i am referring to the url providing the tiles (png files in x y z) (not title lol) of the wms server
In res tile_sources i have different sources but no url
noog
Freshman
Freshman
 
Posts: 4
Joined: Mon Mar 14, 2011 5:54 pm

Re: OSM android tile source

Postby ruelblapid » Tue Mar 15, 2011 12:54 pm

hehehehe :lol: funny.. Sorry I think I have eye problem I guess I should use an eye glass :D

Check the OSMConverter.java inside that class there are file paths eg:
sourceFile = "osmdata/map.osm"; <--- I think this is the source you're looking for.
tilesDir = "osm_android/maps";
namesFile = "osm_android/names/names.txt";


Hope this will help.

Best,
Ruel B. Lapid
Senior Android Engineer
User avatar
ruelblapid
Experienced Developer
Experienced Developer
 
Posts: 65
Joined: Mon Mar 14, 2011 2:37 am

Re: OSM android tile source

Postby noog » Tue Mar 15, 2011 1:48 pm

ruelblapid wrote:hehehehe :lol: funny.. Sorry I think I have eye problem I guess I should use an eye glass :D

Check the OSMConverter.java inside that class there are file paths eg:
sourceFile = "osmdata/map.osm"; <--- I think this is the source you're looking for.
tilesDir = "osm_android/maps";
namesFile = "osm_android/names/names.txt";


Hope this will help.

Best,

i can't find this file in openstreetmapviewer, and i don't think this is the sourcefile
the url must begin with http://
noog
Freshman
Freshman
 
Posts: 4
Joined: Mon Mar 14, 2011 5:54 pm

Re: OSM android tile source

Postby ruelblapid » Tue Mar 15, 2011 2:00 pm

You need to push the raw osm manually to your sdcard. Please refer to this link for more details
http://code.google.com/p/osm-android/wi ... structions
let me know if this url is useful.

If you want you can develop additional feature in your application wherein it will download the osm you wanted then develop your custom osm converter once all assets needed has been converted the main screen of the application will show up.

looks like you're using different source.. NOTE: I'm using OSMDroid just follow the link I provided

Best,
Ruel B. Lapid
Senior Android Engineer
User avatar
ruelblapid
Experienced Developer
Experienced Developer
 
Posts: 65
Joined: Mon Mar 14, 2011 2:37 am

Top

Re: OSM android tile source

Postby ruelblapid » Tue Mar 15, 2011 2:08 pm

Got it dude, the url is in the TileSourceFactory.java everything you needed to know are inside this class.

Best,
Ruel B. Lapid
Senior Android Engineer
User avatar
ruelblapid
Experienced Developer
Experienced Developer
 
Posts: 65
Joined: Mon Mar 14, 2011 2:37 am

Re: OSM android tile source

Postby noog » Tue Mar 15, 2011 4:57 pm

ruelblapid wrote:Got it dude, the url is in the TileSourceFactory.java everything you needed to know are inside this class.

Best,

ok ! thank you so much!! :)
noog
Freshman
Freshman
 
Posts: 4
Joined: Mon Mar 14, 2011 5:54 pm

Re: OSM android tile source

Postby ruelblapid » Tue Mar 15, 2011 11:06 pm

You're welcome,

Best,
Ruel B. Lapid
Senior Android Engineer
User avatar
ruelblapid
Experienced Developer
Experienced Developer
 
Posts: 65
Joined: Mon Mar 14, 2011 2:37 am

Top

Return to Map Problems

Who is online

Users browsing this forum: No registered users and 3 guests