org.osmdroid.views.overlay.MapEventsOverlay Java Examples

The following examples show how to use org.osmdroid.views.overlay.MapEventsOverlay. 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: MapFragment.java    From AndroidApp with Mozilla Public License 2.0 6 votes vote down vote up
private void mapSetup() {
    map = (MapView) getActivity().findViewById(R.id.map);  // create basic map
    mController = map.getController(); // get map controller
    map.setTileSource(TileSourceFactory.MAPNIK);
    map.setTilesScaledToDpi(true);
    map.setMultiTouchControls(true);

    // add compass to map
    CompassOverlay compassOverlay = new CompassOverlay(getActivity(), new InternalCompassOrientationProvider(getActivity()), map);
    compassOverlay.enableCompass();
    map.getOverlays().add(compassOverlay);

    //attach listeners
    MapEventsOverlay mapEventsOverlay = new MapEventsOverlay(this);
    map.getOverlays().add(0, mapEventsOverlay);
    setupMyLocation();
}