Edit an itinerary on the map
EditorMapView draws the map an itinerary is edited on. It hands you a MapClient, the object every drawing command goes through.
The editor needs three more packages beside the map's install line:
onClientReady is the one required prop: it hands you the MapClient. Use ViewerMapView, with the same props, for a map that shows an itinerary nobody may change.
Arm an edit, listen to the drafts it produces, and end it when you are done:
A draft arrives live on every frame of a drag, and settled once the drag ends. Record one undo step per settled draft.
A routed segment asks a SegmentRouteFn for its line. The studio passes one that calls the Data API's directions; on your own EditorMapView, pass the router you have.
useStudioMapBindings(client, options?) from @mountaya/studio-react/map binds the map to a studio, with every hook below in the right order. Call it once per map.
video takes a recorder factory. Pass nothing and no recorder is built.
createMapClientStub and createMapClientSpy from @mountaya/elements/testing stand in for the map client in a test suite. See Testing.