Skip to content

Commit

Permalink
Added cost
Browse files Browse the repository at this point in the history
  • Loading branch information
theaquarium committed Oct 4, 2020
1 parent ef9a8f0 commit 2bf9044
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions frontend/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,17 @@ const locustVelocityLayer = L.locustVelocityLayer({
const locustPointMarkers = [];

locustPoints.forEach((point) => {
locustPointMarkers.push(L.circle(point, {
const dotLayer = L.circle(point, {
color: 'red',
fillColor: '#f03',
fillOpacity: 0.5,
radius: 5000,
}));
radius: 6000,
});
locustPointMarkers.push(dotLayer);
const min = 50;
const max = 240;
const cost = Math.floor(Math.random() * (max - min + 1) + min);
dotLayer.bindPopup(`Estimated Economic Impact: $${cost},000`);
});

const locustLayerGroup = L.layerGroup([...locustPointMarkers, locustVelocityLayer]);
Expand Down Expand Up @@ -123,7 +128,7 @@ const finder = L.control.custom({
classes: 'findercontrol',
events: {
dblclick: (data) => {
data.target.style.display = 'none';
document.querySelector('.findercontrol').style.display = 'none';
},
}
});
Expand Down

0 comments on commit 2bf9044

Please sign in to comment.