Revize 1e2f25c9
Přidáno uživatelem Václav Honzík před téměř 3 roky(ů)
frontend/src/features/TrackingTool/Map/MapPath.tsx | ||
---|---|---|
3 | 3 |
import { RootState } from '../../redux/store' |
4 | 4 |
import { PathVariant, MapPoint, isMapPointDisplayable } from './pathUtils' |
5 | 5 |
import TextPath from 'react-leaflet-textpath' |
6 |
import { setPrimaryIdx, updateMapMarker } from '../trackingToolSlice' |
|
6 |
import { setPrimaryIdx, updateMapMarker, updateMapMarkerWithId } from '../trackingToolSlice'
|
|
7 | 7 |
import MapMarker from './MapMarker' |
8 | 8 |
import { LatLngTuple } from 'leaflet' |
9 | 9 |
import { Popup, Tooltip } from 'react-leaflet' |
... | ... | |
75 | 75 |
edges.push( |
76 | 76 |
<TextPath |
77 | 77 |
// Somehow this refuses to work so let it rerender everything ... |
78 |
key={`${start.id}-${end.id}:${start.latitude},${start.longitude}-${end.latitude},${end.longitude}`}
|
|
78 |
key={`${activeMapPoints[i].id}-${activeMapPoints[i + 1].id}`}
|
|
79 | 79 |
positions={[ |
80 | 80 |
[start.latitude, start.longitude], |
81 | 81 |
[end.latitude, end.longitude], |
... | ... | |
107 | 107 |
setVertices( |
108 | 108 |
displayableMapPoints.map((item) => ( |
109 | 109 |
<MapMarker |
110 |
key={`${item.catalogItem.latitude}${item.catalogItem.longitude}`}
|
|
110 |
key={`${item.catalogItem.id}`}
|
|
111 | 111 |
position={[ |
112 | 112 |
item.catalogItem.latitude as number, |
113 | 113 |
item.catalogItem.longitude as number, |
114 | 114 |
]} |
115 | 115 |
updatePositionCallbackFn={(position: LatLngTuple) => { |
116 | 116 |
dispatch( |
117 |
updateMapMarker({ |
|
117 |
updateMapMarkerWithId({
|
|
118 | 118 |
item: { |
119 | 119 |
...item, |
120 | 120 |
catalogItem: { |
... | ... | |
123 | 123 |
longitude: position[1], |
124 | 124 |
}, |
125 | 125 |
}, |
126 |
id: item.id, |
|
126 | 127 |
}) |
127 | 128 |
) |
128 | 129 |
}} |
frontend/src/utils/id/uuidGenerator.ts | ||
---|---|---|
1 |
import { v4 as uuidv4 } from 'uuid' |
|
2 |
|
|
3 |
// So we do not have to import v4 in this annoying way |
|
4 |
const generateUuid = () => uuidv4() |
|
5 |
export default generateUuid |
Také k dispozici: Unified diff
somewhat functional reoder with visibility toggles
re #9741