osmdroid XYTileSource not showing tiles from a custom server

117 views
Skip to first unread message

Hishan Melanga

unread,
May 29, 2013, 10:52:00 PM5/29/13
to and...@googlegroups.com
I know this is not the place to ask this kind of a question but I've posted this question in various forum but still no answer. So I am asking it in here any ways. Or if you can tell me how andnav application retrieves osm tiles I can use that as a lead.
 
I am using OSMdroid API for displaying custom tiles. So trying to display tiles from my local server
Here is my code
 
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
mapView = (MapView) findViewById(R.id.openmapview);
mapView.setBuiltInZoomControls(true);
 
//zoom to Netherlands
mapView.getController().setZoom(5);
mapView.getController().setCenter(new GeoPoint(51500000, 5400000));
final MapTileProviderBasic tileProvider = new MapTileProviderBasic(getApplicationContext());
final ITileSource tileSource = new XYTileSource("SomeName", null, 3,14, 256, ".png", http://192.168.1.5/mapcache/tms/1.0.0/ms-base@GoogleMapsCompatible/);
tileProvider.setTileSource(tileSource);
final TilesOverlay tilesOverlay = new TilesOverlay(tileProvider, this.getBaseContext());
mapView.getOverlays().add(tilesOverlay);
 
in the layout I have declared map view in the following way
 
<org.osmdroid.views.MapView
android:id="@+id/openmapview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
 
Can anyone please help me make this work? My tilserver is working properly. e.g. I can access map tiles using links such as http://192.168.1.5/mapcache/tms/1.0.0/ms-base@GoogleMapsCompatible/5/0/0.png
 

tempora tempora

unread,
Jun 3, 2013, 7:43:48 PM6/3/13
to and...@googlegroups.com
Look in the OpenStreetMapAndNavBaseActivity class.
TileSourceFactory.addTileSource(
                   new OSMMapGoogleRenderer("Google Maps", ResourceProxy.string.unknown, 0, 19, 256, ".png",
                                            size, "http://mt0.google.com/vt/lyrs=m@127&"));


And keep in mind that 192.168 isn't available from the mobile network.


2013/5/30 Hishan Melanga <his...@gmail.com>
 

--
You received this message because you are subscribed to the Google Groups "AndRoad" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androad+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Hishan Melanga

unread,
Jun 3, 2013, 8:21:42 PM6/3/13
to and...@googlegroups.com
Thank you very much. I have figured it out. Yeah, 192.168 isn't available from the mobile network. I used it to access my tile server. Now it's working.
Reply all
Reply to author
Forward
0 new messages