Skip to content

Commit 8dd910d

Browse files
Merge pull request #1060 from DonovanAndrews300/donovan/toggle-map-info
Hides extra map elements
2 parents 0401e7e + 5f61fa0 commit 8dd910d

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/app/globals.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,8 @@
198198
}
199199

200200
#main .maplibregl-ctrl-bottom-left {
201-
left: 20px;
201+
left: 10px;
202+
padding-bottom: 10px;
202203
pointer-events: bounding-box;
203204
}
204205

src/components/PropertyMap.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
Dispatch,
99
SetStateAction,
1010
ReactElement,
11+
ElementRef,
1112
} from 'react';
1213
import {
1314
maptilerApiKey,
@@ -115,7 +116,6 @@ const MapControls = () => {
115116
<>
116117
<NavigationControl showCompass={false} position="bottom-right" />
117118
<GeolocateControl position="bottom-right" />
118-
<ScaleControl />
119119
{smallScreenToggle || window.innerWidth > 640 ? (
120120
<MapLegendControl
121121
position="bottom-left"
@@ -445,6 +445,14 @@ const PropertyMap: FC<PropertyMapProps> = ({
445445
}}
446446
onLoad={(e) => {
447447
setMap(e.target);
448+
const attributionButton: HTMLElement | null = document.querySelector(
449+
'.maplibregl-ctrl-attrib-button'
450+
);
451+
if (attributionButton) {
452+
attributionButton.click();
453+
} else {
454+
console.warn('Attribution button not found.');
455+
}
448456
}}
449457
onSourceData={(e) => {
450458
handleSetFeatures(e);

0 commit comments

Comments
 (0)