Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion src/components/TaskClusterMap/TaskClusterMap.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,21 @@ export const TaskClusterMap = (props) => {
const { workspaceContext, setWorkspaceContext } = props;
const [currentBounds, setCurrentBounds] = useState(null);
const [searchOpen, setSearchOpen] = useState(false);
const [searchBounds, setSearchBounds] = useState(null);
const [currentZoom, setCurrentZoom] = useState();
const [drawerOpen, setDrawerOpen] = useState(true);
const [showPriorityBounds, setShowPriorityBounds] = useState(false);

const FlyToSearchBounds = () => {
const map = useMap();
useEffect(() => {
if (searchBounds) {
map.fitBounds(searchBounds);
}
}, [searchBounds]);
return null;
};

// Check if we have valid priority bounds data
const hasPriorityBounds = () => {
if (!props.challenge) return false;
Expand Down Expand Up @@ -357,12 +368,15 @@ export const TaskClusterMap = (props) => {
<SearchContent
{...props}
onResultSelected={(bounds) => {
setCurrentBounds(toLatLngBounds(bounds));
const latLngBounds = toLatLngBounds(bounds);
setSearchBounds(latLngBounds);
setCurrentBounds(latLngBounds);
props.updateBounds(bounds);
}}
closeSearch={() => setSearchOpen(false)}
/>
)}
<FlyToSearchBounds />
<MapMarkers
{...props}
allowSpidering
Expand Down
Loading