added function to the bin model to get the bushels from either the settings or the status based on the inventory control and replaced the instances in the bin card and visualizer where it was getting it from the settings with the function
This commit is contained in:
parent
acbd49b907
commit
b197f34f33
5 changed files with 132 additions and 109 deletions
|
|
@ -185,6 +185,8 @@ import { Result } from "@mapbox/mapbox-gl-geocoder";
|
|||
const [measurement, setMeasurement] = useState(false);
|
||||
const [measurementData, setMeasurementData] = useState<Map<string, MeasurementData>>(new Map());
|
||||
const measurementRef = useRef(measurementData);
|
||||
const zoomRef = useRef(15)
|
||||
const fieldMarkerZoom = 15
|
||||
|
||||
//watches for changes to the viewing as and sets the load boolean to trigger a load
|
||||
useEffect(() => {
|
||||
|
|
@ -591,12 +593,13 @@ import { Result } from "@mapbox/mapbox-gl-geocoder";
|
|||
}
|
||||
let newFM = fieldMarkers.get(newKey);
|
||||
if (newFM) {
|
||||
setCurrentView({
|
||||
let view = {
|
||||
latitude: newFM.lat(),
|
||||
longitude: newFM.long(),
|
||||
zoom: 12,
|
||||
zoom: currentView.zoom,
|
||||
transitionDuration: 1000
|
||||
});
|
||||
}
|
||||
setCurrentView(view);
|
||||
}
|
||||
setObjectKey(newKey);
|
||||
setFMIndexKey(newID);
|
||||
|
|
@ -621,12 +624,13 @@ import { Result } from "@mapbox/mapbox-gl-geocoder";
|
|||
}
|
||||
let newFM = fieldMarkers.get(newKey);
|
||||
if (newFM) {
|
||||
setCurrentView({
|
||||
let view = {
|
||||
latitude: newFM.lat(),
|
||||
longitude: newFM.long(),
|
||||
zoom: 12,
|
||||
zoom: currentView.zoom,
|
||||
transitionDuration: 1000
|
||||
});
|
||||
}
|
||||
setCurrentView(view);
|
||||
}
|
||||
setObjectKey(newKey);
|
||||
setFMIndexKey(newID);
|
||||
|
|
@ -728,13 +732,14 @@ import { Result } from "@mapbox/mapbox-gl-geocoder";
|
|||
subtype: fm.type(),
|
||||
mini: true,
|
||||
clickFunc: (event, index) => {
|
||||
console.log(zoomRef)
|
||||
clickDelay();
|
||||
closeDrawers();
|
||||
setIgnoreFeatures(true);
|
||||
setCurrentView({
|
||||
latitude: fm.lat(),
|
||||
longitude: fm.long(),
|
||||
zoom: 12,
|
||||
zoom: zoomRef.current,
|
||||
transitionDuration: 0
|
||||
//transitionInterpolator: new FlyToInterpolator()
|
||||
});
|
||||
|
|
@ -1115,14 +1120,16 @@ import { Result } from "@mapbox/mapbox-gl-geocoder";
|
|||
let xOff = !mobileOffset ? -250 : undefined;
|
||||
let yOff = mobileOffset ? -150 : undefined;
|
||||
|
||||
setCurrentView({
|
||||
let view = {
|
||||
latitude: lat,
|
||||
longitude: long,
|
||||
zoom: zoom,
|
||||
transitionDuration: transDuration,
|
||||
xOffset: center ? 0 : xOff,
|
||||
yOffset: center ? 0 : yOff
|
||||
});
|
||||
}
|
||||
setCurrentView(view);
|
||||
zoomRef.current = zoom
|
||||
};
|
||||
|
||||
const markerDialog = () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue