From eafaefe733be499b4935eb76905309269e4af32f Mon Sep 17 00:00:00 2001 From: Matt Huntington Date: Fri, 9 Sep 2022 19:16:54 -0400 Subject: [PATCH] clear rects when using form --- app.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app.js b/app.js index d77030b..9765861 100644 --- a/app.js +++ b/app.js @@ -49,6 +49,8 @@ d3.select('svg').call(dragBehavior); d3.select('form').on('submit', function(){ d3.event.preventDefault(); + d3.selectAll('rect').remove(); + const lat1 = d3.select('input:first-child').node().value const lng1 = d3.select('input:nth-child(2)').node().value const location1 = worldProjection([lat1, lng1]);