fix(position api bar): position api bar

This commit is contained in:
Laurian-Dufrechou
2023-05-20 15:49:22 +02:00
parent 36182eb47b
commit 9f9595f94f
2 changed files with 7 additions and 9 deletions
+1 -2
View File
@@ -41,9 +41,8 @@ export default function MapComponent(props: any) {
) : ( ) : (
<MapContainer <MapContainer
center={location} center={location}
maxZoom={18}
zoom={13} zoom={13}
minZoom={8} minZoom={6}
zoomControl={false} zoomControl={false}
style={{ width: "100vw", height: "100vw" }} style={{ width: "100vw", height: "100vw" }}
> >
+6 -7
View File
@@ -56,7 +56,7 @@ export default function Map() {
} = useQuery({ } = useQuery({
queryKey: ["listBars"], queryKey: ["listBars"],
refetchOnWindowFocus: false, refetchOnWindowFocus: false,
enabled: Boolean(loggedUser), enabled: Boolean(loggedUser) && loggedUser.location.length > 0,
queryFn: async () => { queryFn: async () => {
///Utiliser api de noratim ///Utiliser api de noratim
@@ -65,12 +65,11 @@ export default function Map() {
); );
let coordinates; let coordinates;
if (location[0] === null || location[1] === null) if (location[0] === null || location[1] === null) {
coordinates = const co = loggedUser.location.split(",");
loggedUser.location[1].toString() + coordinates = co[1].toString() + " " + co[0].toString();
" " + } else
loggedUser.location[0].toString(); coordinates = location[1].toString() + " " + location[0].toString();
else coordinates = location[1].toString() + " " + location[0].toString();
urlBars.searchParams.append( urlBars.searchParams.append(
"where", "where",