Do not start() while the camera is moving.fit()/fitBounds are animated on both
providers, and a click resolved mid-animation lands at the pre-animation projection — off by
exactly 2× when the fit changed zoom by one level. Await the map first:
layer.fit(); awaitfim.whenIdle(); // resolves immediately-ish when the map is already still regionDraw.start();
This module cannot enforce that itself: it is headless by design (it knows only fim's own
methods, never a map SDK), so the wait belongs to the caller that moved the camera.
Event types the host must enable.polygon and rectangle need only click; rectangle
additionally uses hover for its rubber band. freehand and brush prefer
mousedown/mouseup, so enable them:
Without those two, the drag modes fall back to click-to-start / click-to-stop rather than
silently doing nothing — which is also how they behave on a touch device that never reports a
button press.
Mount a modal selection tool over
fim.Do not
start()while the camera is moving.fit()/fitBoundsare animated on both providers, and a click resolved mid-animation lands at the pre-animation projection — off by exactly 2× when the fit changed zoom by one level. Await the map first:This module cannot enforce that itself: it is headless by design (it knows only
fim's own methods, never a map SDK), so the wait belongs to the caller that moved the camera.Event types the host must enable.
polygonandrectangleneed onlyclick;rectangleadditionally useshoverfor its rubber band.freehandandbrushprefermousedown/mouseup, so enable them:Without those two, the drag modes fall back to click-to-start / click-to-stop rather than silently doing nothing — which is also how they behave on a touch device that never reports a button press.