Skip to content

Commit

Permalink
Merge pull request #1060 from DonovanAndrews300/donovan/toggle-map-info
Browse files Browse the repository at this point in the history
Hides extra map elements
  • Loading branch information
CodeWritingCow authored Dec 30, 2024
2 parents 0401e7e + 5f61fa0 commit 8dd910d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@
}

#main .maplibregl-ctrl-bottom-left {
left: 20px;
left: 10px;
padding-bottom: 10px;
pointer-events: bounding-box;
}

Expand Down
10 changes: 9 additions & 1 deletion src/components/PropertyMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
Dispatch,
SetStateAction,
ReactElement,
ElementRef,
} from 'react';
import {
maptilerApiKey,
Expand Down Expand Up @@ -115,7 +116,6 @@ const MapControls = () => {
<>
<NavigationControl showCompass={false} position="bottom-right" />
<GeolocateControl position="bottom-right" />
<ScaleControl />
{smallScreenToggle || window.innerWidth > 640 ? (
<MapLegendControl
position="bottom-left"
Expand Down Expand Up @@ -445,6 +445,14 @@ const PropertyMap: FC<PropertyMapProps> = ({
}}
onLoad={(e) => {
setMap(e.target);
const attributionButton: HTMLElement | null = document.querySelector(
'.maplibregl-ctrl-attrib-button'
);
if (attributionButton) {
attributionButton.click();
} else {
console.warn('Attribution button not found.');
}
}}
onSourceData={(e) => {
handleSetFeatures(e);
Expand Down

0 comments on commit 8dd910d

Please sign in to comment.