Skip to content

Commit

Permalink
definition age
Browse files Browse the repository at this point in the history
  • Loading branch information
TizziGri committed May 13, 2023
1 parent 466e445 commit 031c86c
Showing 1 changed file with 22 additions and 12 deletions.
34 changes: 22 additions & 12 deletions prototype-1/main.js
@@ -1,4 +1,6 @@

import { BUILDINGS } from "./buildings.js";
let people = null;
const oldPerson = "https://svgsilh.com/svg/1800224.svg";
const child = "https://svgsilh.com/svg/44050.svg";
// VARIABLES
Expand Down Expand Up @@ -64,7 +66,9 @@ setTimeout(() => {
shadowSize: [68, 95],
shadowAnchor: [22, 94],
});
L.marker(p.position, { icon: myIcon, title: "ALTE PERSON" }).addTo(map);
p.title = p.age < 10 ? "U10" : p.age > 70 ? "Ü70" : null;
if (!p.title) return;
L.marker(p.position, { icon: myIcon, title: p.title }).addTo(map);
});
}, T + 1000);
// PHASE T + TWO HOUR
Expand Down Expand Up @@ -99,13 +103,15 @@ Papa.parse('data/geodaten.csv', {
return
}
// koordinaten ins array hinzufügen
geodata.push(coordpair);
if (geodata.length < 100) {
L.marker(coordpair).addTo(map);
}
bro.position = coordpair;
geodata.push(bro);
// if (geodata.length < 100) {
// L.marker(coordpair).addTo(map);
//}

});

people = geodata;
//console.log(geodata);


Expand All @@ -125,12 +131,16 @@ const getRandomBuilding = () => {
*/
const createRandomPeople = (noPeople, center) => {
console.log(noPeople, center);
const peopleArray = [];
while (peopleArray.length < noPeople) {
peopleArray.push({
age: createRandomInt(100),
position: getRandomBuilding(),
});
}
let peopleArray = [];
people.forEach((person)=> {

if (peopleArray.length < noPeople) {

person.age= createRandomInt(100);

peopleArray.push(person);
}
});

return peopleArray;
};

0 comments on commit 031c86c

Please sign in to comment.