From 1fb2f2875021aecf9aec9620f82db5e8d552af3a Mon Sep 17 00:00:00 2001 From: gvarnavi Date: Fri, 17 May 2024 09:57:45 -0700 Subject: [PATCH] quick interactivity for Craig --- src/onemit2024.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/onemit2024.md b/src/onemit2024.md index 343b306..d9520fb 100644 --- a/src/onemit2024.md +++ b/src/onemit2024.md @@ -57,6 +57,7 @@ const fly_duration = 20000; const access_token = "pk.eyJ1IjoiZ3Zhcm5hdmlkZXMiLCJhIjoiY2pxZTVicmY2NGJyYTQ4cHBpMHF1MnQ0cCJ9.DuX_gamAs2uXdmq8Gio90Q"; const mapbox_style = "mapbox://styles/gvarnavides/clvmxvwcy01bb01rj7q509sg6"; const server_prefix = "https://onemitdata.mit.edu/tiles/"; +const mouse_lng_lat = Mutable([]); const hilbert_source = { 'type': 'geojson', @@ -103,6 +104,7 @@ var bounding_box_geojson = { ] }; + const bounding_box_source = { 'type': 'geojson', 'data': bounding_box_geojson @@ -366,6 +368,11 @@ map.on("load", () => { map.addControl(new mapboxgl.NavigationControl(),'bottom-right'); }); +map.on("click", (e) => { + mouse_lng_lat.push(e.lngLat); + console.log(mouse_lng_lat); +}); + const map_inset = new mapboxgl.Map({ container: 'map_inset', accessToken: access_token,