Class MapViewCalculations
java.lang.Object
slash.navigation.mapview.mapsforge.helpers.MapViewCalculations
Pure calculations behind the
MapsforgeMapView interaction
logic, factored out so they can be unit-tested without a live map view.- Author:
- Christian Pesch
-
Method Summary
Modifier and TypeMethodDescriptionstatic List<NavigationPosition> collectBoundingPositions(BoundingBox mapBoundingBox, BoundingBox routeBoundingBox) The corner positions to fit into view when centering and zooming: the route's box if present, plus the map's box when it is limited and does not already cover the route.static intcomputeAddRow(NavigationPosition lastSelected, PositionsModel positionsModel) The row a new position should be inserted at: after the last selected position, else after the last position in the list, else at the start.static doublethresholdForPixel(double latitude, byte zoomLevel, int tileSize, int selectionCirclePixels) The ground distance (meters) that spans the given number of screen pixels at a zoom level - used as the selection tolerance when hit-testing positions near a map click.
-
Method Details
-
thresholdForPixel
public static double thresholdForPixel(double latitude, byte zoomLevel, int tileSize, int selectionCirclePixels) The ground distance (meters) that spans the given number of screen pixels at a zoom level - used as the selection tolerance when hit-testing positions near a map click.
-