Fun changes
Some checks failed
CI / Python (lint + test) (push) Failing after 3m38s
CI / Rust (lint + test) (push) Failing after 3m32s
CI / Frontend (lint + typecheck) (push) Failing after 4m12s
Build and publish Docker image / build-and-push (push) Failing after 4m48s

This commit is contained in:
Andras Schmelczer 2026-04-04 22:59:44 +01:00
parent cd778dd088
commit 349a6c1d53
60 changed files with 1260 additions and 2600 deletions

View file

@ -174,7 +174,22 @@ export default memo(function Map({
}, [viewState, dimensions, onViewChange]);
const handleMove = useCallback((evt: { viewState: ViewState }) => {
setInternalViewState(evt.viewState);
setInternalViewState((prev) => {
const next = evt.viewState;
// Skip re-render when viewport values haven't changed (e.g. container resize
// fires move events with identical lat/lng/zoom). Returning the same reference
// tells React to bail out.
if (
prev.latitude === next.latitude &&
prev.longitude === next.longitude &&
prev.zoom === next.zoom &&
prev.pitch === next.pitch &&
prev.bearing === next.bearing
) {
return prev;
}
return next;
});
}, []);
const handleFlyTo = useCallback((lat: number, lng: number, zoom: number) => {
@ -324,6 +339,7 @@ export default memo(function Map({
enumValues={
colorFeatureMeta.type === 'enum' ? colorFeatureMeta.values : undefined
}
featureName={colorFeatureMeta.name}
theme={theme}
raw={colorFeatureMeta.raw}
/>