From 00014fdb5a29f67dbfaadb08cffa5deadbbff199 Mon Sep 17 00:00:00 2001 From: Alfakhori <muhammad.alfakhori@hft-stuttgart.de> Date: Thu, 29 Aug 2024 10:10:04 +0000 Subject: [PATCH] Update public/data/pins.csv, public/index.html --- public/data/pins.csv | 2 ++ public/index.html | 9 +++------ 2 files changed, 5 insertions(+), 6 deletions(-) create mode 100644 public/data/pins.csv diff --git a/public/data/pins.csv b/public/data/pins.csv new file mode 100644 index 0000000..3a59ba6 --- /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 50a1912..dfe782d 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 => { -- GitLab