|
38 | 38 | import { ALERT_OPTION_MAX_HEIGHT } from '~/utils/constants'; |
39 | 39 | import { VerticalPosition } from '@nativescript-community/ui-popover'; |
40 | 40 | import dayjs from 'dayjs'; |
| 41 | + import { import { |
| 42 | + cityMinZoom, |
| 43 | + forestPatternZoom, |
| 44 | + rockPatternZoom, |
| 45 | + scrubPatternZoom, |
| 46 | + screePatternZoom, |
| 47 | + contourLinesOpacity, |
| 48 | + emphasisDrinkingWater, |
| 49 | + emphasisRails, |
| 50 | + mapFontScale, |
| 51 | + pitchEnabled, |
| 52 | + preloading, |
| 53 | + projectionModeSpherical, |
| 54 | + rotateEnabled, |
| 55 | + routesType, |
| 56 | + show3DBuildings, |
| 57 | + showContourLines, |
| 58 | + showRoutes, |
| 59 | + showSlopePercentages, |
| 60 | + showSubBoundaries, |
| 61 | + showPolygonsBorder, |
| 62 | + showRoadShields, |
| 63 | + showRouteShields, |
| 64 | + showItemsLayer, |
| 65 | + itemLock |
| 66 | + } from '~/stores/mapStore'; } from '~/stores/mapStore'; |
41 | 67 |
|
42 | 68 | $: ({ colorError, colorOnSurface, colorOnSurfaceVariant, colorOutlineVariant, colorPrimary, colorWidgetBackground } = $colors); |
43 | 69 | const PROFILE_HEIGHT = 150; |
|
275 | 301 | function updateRouteItemWithPosition(routeItem: Item, location: GenericMapPos<LatLonKeys>, updateNavigationInstruction = true, updateGraph = true, highlight?: Highlight<Entry>) { |
276 | 302 | // DEV_LOG && console.log('updateRouteItemWithPosition', !!routeItem?.route, JSON.stringify(location), updateNavigationInstruction, updateGraph, !JSON.stringify(!highlight)); |
277 | 303 | try { |
278 | | - if (routeItem?.route) { |
| 304 | + if (routeItem?.route) { |
| 305 | + const distanceFromRouteMeters = ApplicationSettings.getNumber('location_distance_from_route', 15); |
279 | 306 | // const props = routeItem.properties; |
280 | 307 | const route = routeItem.route; |
281 | 308 | const positions = packageService.getRouteItemPoses(routeItem); |
282 | 309 | // DEV_LOG && console.log('updateRouteItemWithPosition', JSON.stringify(location), JSON.stringify(positions)); |
283 | | - const onPathIndex = isLocationOnPath(location, positions, false, true, 15); |
| 310 | + const onPathIndex = isLocationOnPath(location, positions, false, true, distanceFromRouteMeters); |
284 | 311 | let remainingDistance: number, remainingTime: number; |
285 | 312 | // DEV_LOG && console.log('updateRouteItemWithPosition onPathIndex', onPathIndex, JSON.stringify(routeItem.instructions)); |
286 | 313 | if (onPathIndex !== -1 && (graphAvailable || highlight || (routeItem.instructions && updateNavigationInstruction && !graphAvailable))) { |
|
948 | 975 | </BottomSheetInfoView> |
949 | 976 | <IconButton prop:leftDrawer backgroundColor={colorError} color="white" height="100%" shape="none" text="mdi-trash-can" tooltip={lc('delete')} width={60} on:tap={deleteItem} /> |
950 | 977 |
|
951 | | - <!-- <stacklayout prop:rightDrawer orientation="horizontal"> --> |
| 978 | + <stacklayout prop:rightDrawer orientation="horizontal"> |
952 | 979 | <IconButton |
953 | | - prop:rightDrawer |
| 980 | + |
954 | 981 | backgroundColor={new Color(colorPrimary).setAlpha(180).hex} |
955 | 982 | color="white" |
956 | 983 | height="100%" |
957 | 984 | shape="none" |
958 | 985 | text="mdi-crosshairs-gps" |
959 | 986 | width={60} |
960 | 987 | on:tap={zoomToItem} /> |
961 | | - <!-- </stacklayout> --> |
| 988 | + <IconButton |
| 989 | + |
| 990 | + backgroundColor={new Color(colorPrimary).setAlpha(180).hex} |
| 991 | + color="white" |
| 992 | + height="100%" |
| 993 | + shape="none" |
| 994 | + text={$itemLock ? "mdi-lock-off-outline" : "mdi-lock-outline} |
| 995 | + width={60} |
| 996 | + on:tap={() => $itemLock = !$itemLock} /> |
| 997 | + </stacklayout> |
962 | 998 | </swipemenu> |
963 | 999 |
|
964 | 1000 | <scrollview borderBottomWidth={1} borderColor={colorOutlineVariant} borderTopWidth={1} colSpan={2} orientation="horizontal" row={1}> |
|
0 commit comments