OBM 5 Automate Notebook

API quick reference

This notebook focuses on scripted OneBoxMap interactions and route automation. Most-used elements:

  1. OneBoxMap()

  2. SubmittableTextBox.feed(...)

  3. SubmittableTextBox.submit()

  4. RouteController.set_route_start/at/stop(...)

  5. RouteController.set_route_width(...)

For the complete reference, see API Reference. For route architecture details, see Route engine and widget controller architecture.

API methods used in this notebook

class here_search_demo.widgets.app.OneBoxMap(credentials=None, user_profile=None, results_limit=None, suggestions_limit=None, terms_limit=None, place_taxonomy_buttons=None, extra_api_params=None, on_map=False, fuel=False, tripadvisor=False, recommendations=False, map_only=False, options=None, testing_header=False, **kwargs)

Interactive one-box search application with map and result panels.

OneBoxMap wires text input, taxonomy shortcuts, map rendering and result/details handling into a ready-to-use demo widget.

Parameters:
  • credentials (Credentials | None) – Optional credentials provider.

  • user_profile (UserProfile | None) – Optional user profile controlling language/signals.

  • results_limit (int | None) – Max displayed results.

  • suggestions_limit (int | None) – Max displayed suggestions.

  • terms_limit (int | None) – Max displayed term buttons.

  • place_taxonomy_buttons (PlaceTaxonomyButtons | None) – Optional custom taxonomy buttons widget.

  • extra_api_params (dict | None) – Extra params forwarded to API requests.

  • on_map (bool) – Whether to display controls on map.

  • fuel (bool) – Enable fuel details.

  • tripadvisor (bool) – Enable TripAdvisor details.

  • recommendations (bool) – Enable recommendation reranking flow.

  • map_only (bool) – Hide JSON/log panels and keep map-centric layout.

  • options (APIOptions | None) – Optional prebuilt API options.

  • testing_header (bool) – Include NLP testing header for API calls.

  • kwargs – Forwarded widget/layout options.

run(handle_search_events=None)

Start the background consumer task and return self.

Parameters:

handle_search_events (Optional[Callable]) – Optional coroutine factory replacing the default event loop handler.

Returns:

Running app instance.

Return type:

OneBoxCore

show()

Display the application UI in the current notebook.

This displays the internal root widget without exposing or returning the underlying display handle.

Return type:

None

class here_search_demo.widgets.input_text.SubmittableTextBox(queue, state, *args, **kwargs)

A ipywidgets HBox made of a SubmittableText and a lens Button

async feed(text, delay=None)

Type text programmatically into the input widget.

Useful for notebook demos/tests that simulate user typing. "\b" characters are interpreted as backspace.

Parameters:
  • text – Text sequence to inject.

  • delay (float | None) – Delay in seconds between characters. Defaults to default_simulation_delay_sec.

submit()

Programmatically trigger a submit.

class here_search_demo.widgets.route.RouteController(map_instance, credentials, routing_api_call_handler=None)

Route acquisition and rendering controller for map widgets.

The controller fetches route geometry, renders route overlays/markers, and exposes helpers used by notebooks and UI callbacks to update route start/stop/at positions and corridor width.

Parameters:
  • map_instance (PositionMap) – Map widget receiving route layers.

  • credentials (Credentials) – HERE credentials used for routing requests.

set_current_position(latlon=None)

Set the current car position on the route.

Parameters:

latlon (tuple[float, float] | None) – (lat, lon) current position.

set_route_start(latlon)

Set the route origin marker and trigger route acquisition when complete.

Parameters:

latlon (tuple[float, float]) – (lat, lon) origin position.

set_route_stop(latlon)

Set the route destination marker and trigger route acquisition when complete.

Parameters:

latlon (tuple[float, float]) – (lat, lon) destination position.

set_route_width(width)

Set corridor width (meters) used for route geometry and rerender it.

Parameters:

width (int | None) – Corridor width in meters; None keeps/defaults width.