diff --git a/public/data/pins.csv b/public/data/pins.csv new file mode 100644 index 0000000000000000000000000000000000000000..3a59ba6917c2654a5f20a458cf25cd8f6cc37be7 --- /dev/null +++ b/public/data/pins.csv @@ -0,0 +1,2 @@ +lat,lng,name,color +48.773330,9.181970,Muhammad's first study area,#0000ff diff --git a/public/index.html b/public/index.html index 50a191264fa86135a08bcfe460eb5c61f22e395e..dfe782dfd24a3a3fcd0236f0f2a2c5e9f77ad432 100644 --- a/public/index.html +++ b/public/index.html @@ -3,7 +3,7 @@ <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <title>Study Areas Map</title> + <title>Study Areas Map 2</title> <link rel="stylesheet" href="https://unpkg.com/leaflet/dist/leaflet.css" /> <script src="https://unpkg.com/leaflet/dist/leaflet.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/PapaParse/5.3.0/papaparse.min.js"></script> @@ -37,13 +37,10 @@ maxZoom: 19, }).addTo(map); - // Embedded CSV data as a string (Add pins here manually) - const csvData = `lat,lng,name,color -48.773330,9.181970,Muhammad's first study area,#0000ff`; - // Function to load pins from CSV and add them to the map function loadPins() { - Papa.parse(csvData, { + Papa.parse('/data/pins.csv', { + download: true, header: true, complete: function(results) { results.data.forEach(pin => {