My aggregated monorepo of OCaml code, automaintained
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix map forward-reference in Zarr notebook

Same fix as interactive_map.mld — use map_ref to break the
self-referential binding in Leaflet_map.create's on_click callback.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

+5 -1
+5 -1
site/notebooks/interactive_map_zarr.mld
··· 58 58 59 59 (* --- Map widget (typed interface) --- *) 60 60 61 + let map_ref : Leaflet_map.t option ref = ref None 62 + let map_get () = match !map_ref with Some m -> m | None -> failwith "map not ready" 63 + 61 64 let map = Leaflet_map.create 62 65 ~center:(52.2, 0.12) ~zoom:13 ~height:"500px" 63 66 ~on_bbox_drawn:(fun b -> ··· 70 73 set_training_points ((pt.lat, pt.lng, cls) :: points); 71 74 let color = class_colors.(cls mod Array.length class_colors) in 72 75 let names = Note.S.value class_names_signal in 73 - Leaflet_map.add_marker map pt ~color ~label:names.(cls) ()) 76 + Leaflet_map.add_marker (map_get ()) pt ~color ~label:names.(cls) ()) 74 77 () 78 + let () = map_ref := Some map 75 79 76 80 let () = Leaflet_map.enable_bbox_draw map 77 81