Rename loadStore.js to readPoiMarkersStore.js
This commit is contained in:
@@ -573,7 +573,8 @@ const MapComponent = ({ locations, onLocationUpdate }) => {
|
||||
|
||||
// Popup binden, aber nicht automatisch öffnen
|
||||
marker.bindPopup(
|
||||
`<b>${location.description || "Unbekannt"}</b><br>Type: ${location.idPoiTyp || "N/A"}<br>Lat: ${latitude.toFixed(5)}, Lng: ${longitude.toFixed(5)}`
|
||||
//N/A oder location.idPoiTyp=0 hier soll der Name von poiTyp Tabelle kommen, also foreign key
|
||||
`<b>${location.description || "Unbekannt"}</b><br>Type: ${location.idPoiTyp || "N/A oder location.idPoiTyp=0"}<br>Lat: ${latitude.toFixed(5)}, Lng: ${longitude.toFixed(5)}`
|
||||
);
|
||||
|
||||
// Event-Handler für Mouseover und Mouseout hinzufügen
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
import React, { useState, useEffect } from "react";
|
||||
import ReactDOM from "react-dom";
|
||||
import { useRecoilValue } from "recoil";
|
||||
import { loadDataStore } from "../store/selectors/loadDataStore";
|
||||
import { readPoiMarkersStore } from "../store/selectors/readPoiMarkersStore";
|
||||
const ShowAddStationPopup = ({ map, latlng }) => {
|
||||
const loadData = useRecoilValue(loadDataStore);
|
||||
const loadData = useRecoilValue(readPoiMarkersStore);
|
||||
const [poiTypData2, setPoiTypData2] = useState(); // Recoil State verwenden
|
||||
const [name, setName] = useState("");
|
||||
const [poiTypeId, setPoiTypeId] = useState(""); // Initialize as string
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import dynamic from "next/dynamic";
|
||||
import { useSetRecoilState } from "recoil";
|
||||
import { loadDataStore } from "../store/selectors/loadDataStore";
|
||||
import { readPoiMarkersStore } from "../store/selectors/readPoiMarkersStore";
|
||||
const MapComponentWithNoSSR = dynamic(
|
||||
() => import("../components/MapComponent"),
|
||||
{ ssr: false }
|
||||
);
|
||||
|
||||
export default function Home() {
|
||||
const setLoadData = useSetRecoilState(loadDataStore);
|
||||
const setLoadData = useSetRecoilState(readPoiMarkersStore);
|
||||
const [mParam, setMParam] = useState([""]);
|
||||
const [uParam, setUParam] = useState([""]);
|
||||
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import dynamic from "next/dynamic";
|
||||
import { useSetRecoilState } from "recoil";
|
||||
import { loadDataStore } from "../store/selectors/loadDataStore";
|
||||
import { readPoiMarkersStore } from "../store/selectors/readPoiMarkersStore";
|
||||
const MapComponentWithNoSSR = dynamic(
|
||||
() => import("../components/MapComponent"),
|
||||
{ ssr: false }
|
||||
);
|
||||
|
||||
export default function Home() {
|
||||
const setLoadData = useSetRecoilState(loadDataStore);
|
||||
const setLoadData = useSetRecoilState(readPoiMarkersStore);
|
||||
const [mParam, setMParam] = useState([""]);
|
||||
const [uParam, setUParam] = useState([""]);
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// store/loadDataStore.js
|
||||
// store/readPoiMarkersStore.js
|
||||
import { atom } from "recoil";
|
||||
|
||||
export const loadDataStore = atom({
|
||||
key: "loadDataStore",
|
||||
export const readPoiMarkersStore = atom({
|
||||
key: "readPoiMarkersStore",
|
||||
default: async () => {
|
||||
const response = await fetch("/api/readLocations");
|
||||
const data = await response.json();
|
||||
Reference in New Issue
Block a user