Search in sources :

Example 1 with MapTileProviderBasic

use of org.osmdroid.tileprovider.MapTileProviderBasic in project android-sdk-examples by IndoorAtlas.

the class OpenStreetMapOverlay method onResume.

@Override
protected void onResume() {
    super.onResume();
    if (mOsmv == null) {
        mOsmv = new MapView(this);
        mOsmv.setTilesScaledToDpi(true);
        mOsmv.setBuiltInZoomControls(true);
        mOsmv.getController().setZoom(18);
        mProvider = new MapTileProviderBasic(getApplicationContext());
        mProvider.setTileSource(TileSourceFactory.DEFAULT_TILE_SOURCE);
        mTilesOverlay = new TilesOverlay(mProvider, getBaseContext());
        mOsmv.getOverlays().add(mTilesOverlay);
        mLayout = new RelativeLayout(this);
        mLayout.addView(mOsmv, new RelativeLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
        setContentView(mLayout);
    }
    // start receiving location updates & monitor region changes
    mIALocationManager.requestLocationUpdates(IALocationRequest.create(), mListener);
    mIALocationManager.registerRegionListener(mRegionListener);
}
Also used : MapTileProviderBasic(org.osmdroid.tileprovider.MapTileProviderBasic) RelativeLayout(android.widget.RelativeLayout) MapView(org.osmdroid.views.MapView) TilesOverlay(org.osmdroid.views.overlay.TilesOverlay) LayoutParams(android.widget.RelativeLayout.LayoutParams)

Aggregations

RelativeLayout (android.widget.RelativeLayout)1 LayoutParams (android.widget.RelativeLayout.LayoutParams)1 MapTileProviderBasic (org.osmdroid.tileprovider.MapTileProviderBasic)1 MapView (org.osmdroid.views.MapView)1 TilesOverlay (org.osmdroid.views.overlay.TilesOverlay)1