Skip to content

Commit

Permalink
fix: linhas SPPO arrumadas e centralizando o mapa
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel0109 committed Mar 16, 2023
1 parent 915c355 commit bba712c
Show file tree
Hide file tree
Showing 13 changed files with 361 additions and 141 deletions.
9 changes: 4 additions & 5 deletions src/assets/imgs/proximity.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions src/assets/styles/globals.scss
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,23 @@ background-image: url(../imgs/movingMarker.svg);
padding: 8px;
border-radius: 50em;

}
.centerButton {
background-color: #FFFFFF;
z-index: 1002;
position: absolute;
top: 85px;
left: 10px;
padding: 8px;
border-radius: 50em;

svg {
width: 22.5px;
height: 22.5px;
}

}
.leaflet-popup-content{
margin: 0 !important;
padding: 10px 22px;
}
31 changes: 31 additions & 0 deletions src/components/CenterButton.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { useContext, useEffect, useState } from "react";
import { Popup, useMap } from "react-leaflet";
import { CodeContext } from "../hooks/getCode";
import { MovingMarkerContext } from "../hooks/getMovingMarkers";
import { MdMyLocation } from 'react-icons/md'



export default function CenterButton({ location }) {
const { center } = useContext(MovingMarkerContext)
const { stopId } = useContext(CodeContext)
const map = useMap()
function fixCenter() {
console.log(location)
map.setView(location);

}
useEffect(() => {
fixCenter()
}, [center, stopId])


return (
<>
<button className='centerButton inputShadow' onClick={() => fixCenter()}>
<MdMyLocation />
</button>

</>
);
}
3 changes: 3 additions & 0 deletions src/components/Header/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ export function Header(props) {
</div>

</header>
{/* <div className='warning absolute z-[402] bg-white px-5 py-2 right-0 rounded-md border-2 border-slate-200'>
<p className='text-red-600'>Versão Beta para testes</p>
</div> */}
</>
)
}
Loading

0 comments on commit bba712c

Please sign in to comment.