Search in sources :

Example 6 with OsmandMap

use of net.osmand.plus.views.OsmandMap in project Osmand by osmandapp.

the class MapControlsLayer method setupZoomInButton.

public MapHudButton setupZoomInButton(View zoomInButton, OnLongClickListener longClickListener, String buttonId) {
    MapHudButton mapZoomInButton = createHudButton(zoomInButton, R.drawable.ic_zoom_in, buttonId);
    mapZoomInButton.setRoundTransparent();
    zoomInButton.setOnLongClickListener(longClickListener);
    zoomInButton.setOnClickListener(v -> {
        if (requireMapActivity().getContextMenu().zoomInPressed()) {
            return;
        }
        OsmandMap osmandMap = app.getOsmandMap();
        if (mapView.isZooming()) {
            osmandMap.changeZoom(2, System.currentTimeMillis());
        } else {
            osmandMap.changeZoom(1, System.currentTimeMillis());
        }
        lastZoom = System.currentTimeMillis();
    });
    controls.add(mapZoomInButton);
    return mapZoomInButton;
}
Also used : OsmandMap(net.osmand.plus.views.OsmandMap)

Aggregations

OsmandMap (net.osmand.plus.views.OsmandMap)6 RoutingHelper (net.osmand.plus.routing.RoutingHelper)2 Intent (android.content.Intent)1 Message (android.os.Message)1 OsmandAidlApi (net.osmand.aidl.OsmandAidlApi)1 RotatedTileBox (net.osmand.data.RotatedTileBox)1 OsmandRegions (net.osmand.map.OsmandRegions)1 MapPoiTypes (net.osmand.osm.MapPoiTypes)1 OsmandApplication (net.osmand.plus.OsmandApplication)1 MapActivity (net.osmand.plus.activities.MapActivity)1 BackupHelper (net.osmand.plus.backup.BackupHelper)1 NetworkSettingsHelper (net.osmand.plus.backup.NetworkSettingsHelper)1 MapViewTrackingUtilities (net.osmand.plus.base.MapViewTrackingUtilities)1 AnalyticsHelper (net.osmand.plus.helpers.AnalyticsHelper)1 AvoidSpecificRoads (net.osmand.plus.helpers.AvoidSpecificRoads)1 DayNightHelper (net.osmand.plus.helpers.DayNightHelper)1 LauncherShortcutsHelper (net.osmand.plus.helpers.LauncherShortcutsHelper)1 LockHelper (net.osmand.plus.helpers.LockHelper)1 TargetPointsHelper (net.osmand.plus.helpers.TargetPointsHelper)1 WaypointHelper (net.osmand.plus.helpers.WaypointHelper)1