Skip to content

Commit

Permalink
DBC22-1931: minor styling fix, cleanup popup code
Browse files Browse the repository at this point in the history
  • Loading branch information
ray-oxd authored and minORC committed Apr 6, 2024
1 parent 653fe73 commit bb5c5ea
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 26 deletions.
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 @@ -297,9 +297,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 @@ -414,9 +411,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 @@ -440,9 +434,6 @@ export default function MapWrapper({
}

updateClickedEvent(feature);

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

const ferryClickHandler = feature => {
Expand All @@ -453,9 +444,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 @@ -466,9 +454,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 @@ -479,9 +464,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 @@ -509,11 +491,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 @@ -1018,8 +995,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

0 comments on commit bb5c5ea

Please sign in to comment.