Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DBC22-1931: minor styling fix, cleanup popup code #361

Merged
merged 1 commit into from
Apr 6, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/frontend/src/Components/Filters.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ button.btn.open-filters {
box-shadow: 0px 1.937px 4.358px 0px rgba(0, 0, 0, 0.13), 0px 0.363px 1.089px 0px rgba(0, 0, 0, 0.10);
padding: 1rem;
z-index: 21;
overflow-y: scroll;
overflow-y: auto;

@media (min-width: 768px) {
position: absolute;
Expand Down
25 changes: 0 additions & 25 deletions src/frontend/src/Components/Map.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,6 @@ export default function MapWrapper({

mapRef.current.once('loadstart', async () => {
if (camera && !isPreview) {
popup.current.setPosition(handleCenter());
popup.current.getElement().style.top = '40px';

if (camera.event_type) {
updateClickedEvent(camera);
} else {
Expand Down Expand Up @@ -415,9 +412,6 @@ export default function MapWrapper({
feature.setStyle(cameraStyles['active']);
feature.setProperties({ clicked: true }, true);

popup.current.setPosition(feature.getGeometry().getCoordinates());
popup.current.getElement().style.top = '40px';

updateClickedCamera(feature);

cameraPopupRef.current = popup;
Expand All @@ -441,9 +435,6 @@ export default function MapWrapper({
}

updateClickedEvent(feature);

popup.current.setPosition(feature.getGeometry().getCoordinates());
popup.current.getElement().style.top = '40px';
};

const ferryClickHandler = feature => {
Expand All @@ -454,9 +445,6 @@ export default function MapWrapper({
feature.setStyle(ferryStyles['active']);
feature.setProperties({ clicked: true }, true);
updateClickedFerry(feature);

popup.current.setPosition(feature.getGeometry().getCoordinates());
popup.current.getElement().style.top = '40px';
};

const weatherClickHandler = feature => {
Expand All @@ -467,9 +455,6 @@ export default function MapWrapper({
feature.setStyle(roadWeatherStyles['active']);
feature.setProperties({ clicked: true }, true);
updateClickedWeather(feature);

popup.current.setPosition(feature.getGeometry().getCoordinates());
popup.current.getElement().style.top = '40px';
};

const regionalClickHandler = feature => {
Expand All @@ -480,9 +465,6 @@ export default function MapWrapper({
feature.setStyle(regionalStyles['active']);
feature.setProperties({ clicked: true }, true);
updateClickedRegional(feature);

popup.current.setPosition(feature.getGeometry().getCoordinates());
popup.current.getElement().style.top = '40px';
};

const restStopClickHandler = (feature) => {
Expand Down Expand Up @@ -510,11 +492,6 @@ export default function MapWrapper({
}
feature.setProperties({ clicked: true }, true);
updateClickedRestStop(feature);

popup.current.setPosition(
feature.getGeometry().getCoordinates(),
);
popup.current.getElement().style.top = '40px';
}

mapRef.current.on('click', async e => {
Expand Down Expand Up @@ -1019,8 +996,6 @@ export default function MapWrapper({
};

function closePopup() {
popup.current.setPosition(undefined);

// camera is set to data structure rather than map feature
if (clickedCameraRef.current && !clickedCameraRef.current.setStyle) {
clickedCameraRef.current = mapLayers.current['highwayCams']
Expand Down
Loading