Java Code Examples for org.osmdroid.views.overlay.CopyrightOverlay#setTextSize()

The following examples show how to use org.osmdroid.views.overlay.CopyrightOverlay#setTextSize() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SampleCopyrightOverlay.java    From osmdroid with Apache License 2.0 6 votes vote down vote up
@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    Log.d(TAG, "onActivityCreated");

    mMapView.getOverlays().clear();
    CopyrightOverlay copyrightOverlay = new CopyrightOverlay(getActivity());
    copyrightOverlay.setTextColor(Color.GREEN);
    copyrightOverlay.setTextSize(20);
    copyrightOverlay.setAlignBottom(true);
    copyrightOverlay.setAlignRight(false);
    copyrightOverlay.setOffset(20,40);
    //with align bottom and left, this should be 20dp from the bottom, 20dp from the left

    mMapView.getOverlays().add(copyrightOverlay);

}
 
Example 2
Source File: BaseSampleFragment.java    From osmdroid with Apache License 2.0 6 votes vote down vote up
@Override
   public void onActivityCreated(Bundle savedInstanceState) {
       super.onActivityCreated(savedInstanceState);
       Log.d(TAG, "onActivityCreated");

       if (mMapView != null) {
           addOverlays();

           final Context context = this.getActivity();
           final DisplayMetrics dm = context.getResources().getDisplayMetrics();

           CopyrightOverlay copyrightOverlay = new CopyrightOverlay(getActivity());
           copyrightOverlay.setTextSize(10);

		mMapView.getOverlays().add(copyrightOverlay);
		mMapView.setMultiTouchControls(true);
		mMapView.setTilesScaledToDpi(true);
	}
}
 
Example 3
Source File: MapActivity.java    From ActivityDiary with GNU General Public License v3.0 4 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Context ctx = getApplicationContext();
    Configuration.getInstance().load(ctx, PreferenceManager.getDefaultSharedPreferences(ctx));

    LayoutInflater inflater = (LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);

    View contentView = inflater.inflate(R.layout.activity_map, null, false);

    setContent(contentView);

    noMap = (TextView) findViewById(R.id.noMap);

    map = (MapView) findViewById(R.id.map);
    map.setTileSource(TileSourceFactory.MAPNIK);
    map.setTilesScaledToDpi(true);
    map.setBuiltInZoomControls(true);
    map.setMultiTouchControls(true);

    IMapController mapController = map.getController();
    mapController.setZoom(14.0);
    GeoPoint startPoint = new GeoPoint(LocationHelper.helper.getCurrentLocation());
    mapController.setCenter(startPoint);

    CopyrightOverlay copyrightOverlay = new CopyrightOverlay(this);
    copyrightOverlay.setTextSize(10);
    map.getOverlays().add(copyrightOverlay);

    ScaleBarOverlay scaleBarOverlay = new ScaleBarOverlay(map);
    map.getOverlays().add(scaleBarOverlay);
    // Scale bar tries to draw as 1-inch, so to put it in the top center, set x offset to
    // half screen width, minus half an inch.
    scaleBarOverlay.setScaleBarOffset(
            (int) (getResources().getDisplayMetrics().widthPixels / 2 - getResources()
                    .getDisplayMetrics().xdpi / 2), 10);

    getLoaderManager().initLoader(LOADER_ID_INIT, null, this);

    mDrawerToggle.setDrawerIndicatorEnabled(false);
}