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
center={location}
maxZoom={18}
zoom={13}
minZoom={8}
minZoom={6}
zoomControl={false}
style={{ width: "100vw", height: "100vw" }}
>
+6 -7
View File
@@ -56,7 +56,7 @@ export default function Map() {
} = useQuery({
queryKey: ["listBars"],
refetchOnWindowFocus: false,
enabled: Boolean(loggedUser),
enabled: Boolean(loggedUser) && loggedUser.location.length > 0,
queryFn: async () => {
///Utiliser api de noratim
@@ -65,12 +65,11 @@ export default function Map() {
);
let coordinates;
if (location[0] === null || location[1] === null)
coordinates =
loggedUser.location[1].toString() +
" " +
loggedUser.location[0].toString();
else coordinates = location[1].toString() + " " + location[0].toString();
if (location[0] === null || location[1] === null) {
const co = loggedUser.location.split(",");
coordinates = co[1].toString() + " " + co[0].toString();
} else
coordinates = location[1].toString() + " " + location[0].toString();
urlBars.searchParams.append(
"where",