I'm trying to put the OSMDroid to work with WMS, but I do not find a way to put the WMS working.
Objective: OSMDroid working with WMS (projection EPSG:4326)
Tentative: I followed this example and include files: WMSMapTileProviderBasic, WMSMapTileDownloader, WMSTileSource, MapTile, and put the following code in my activity:
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// get the mapview holder
LinearLayout mapHolder = (LinearLayout) findViewById(R.id.my_osmdroid_mapview);
// create a new WMS provider
final WMSMapTileProviderBasic tileProvider = new WMSMapTileProviderBasic(getApplicationContext());
// create the WMS tile source
final ITileSource tileSource = new WMSTileSource("WMS", null, 1, 20, 256, ".jpg", "http://myserver.com/geoserver/");
tileProvider.setTileSource(tileSource);
// create a new basic map view
MapView mapView = new MapView(this, 256, new DefaultResourceProxyImpl(this), tileProvider);
// add the layout params to the view so the map fills the screen
mapView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
// add the mapview to display
mapHolder.addView(mapView);
}
}
but did not show anything in map, why?
Thank you for your time.