Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Maps] Allow embeddable clients to check/get notified on loading state #89302

Closed
thomasneirynck opened this issue Jan 26, 2021 · 4 comments
Closed
Assignees
Labels
[Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation enhancement New value added to drive a business result v7.12.0 v8.0.0
Projects

Comments

@thomasneirynck
Copy link
Contributor

Describe the feature:

Clients of the MapEmbeddable can get notified of loading-state (or be able to retrieve loading-state) of an embedded map.

Describe a specific use case for the feature:

Show a loading spinner while the map and layers are initializing.

This would be useful for applications where the map is embedded as part of a larger dashboard. E.g. the anomaly-explorer in ML. You don't want to present an incomplete map, when not all the data has loaded yet.

cc @alvarezmelissa87

@thomasneirynck thomasneirynck added [Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation enhancement New value added to drive a business result v8.0.0 v7.12.0 labels Jan 26, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-gis (Team:Geo)

@thomasneirynck
Copy link
Contributor Author

The main issue here that we need to be able to accurately determine loading state for tile-layers as well. This is also a blocking-feature for tiled layers (e.g. layers backed by vector-tiles) See also #76237.

@thomasneirynck thomasneirynck changed the title [Maps] Allow embeddable clietns to check/get notified on loading state [Maps] Allow embeddable clients to check/get notified on loading state Jan 26, 2021
@thomasneirynck thomasneirynck added this to Backlog in Maps Jan 26, 2021
@thomasneirynck thomasneirynck moved this from Backlog to To do in Maps Jan 26, 2021
@nreese
Copy link
Contributor

nreese commented Jan 26, 2021

The MapEmbeddable exposes a setEventHandlers method that allows for the setting of callbacks that are triggered on layer load events. These should provide the functionality requested by this issue.

https://github.com/elastic/kibana/blob/master/x-pack/plugins/maps/public/reducers/non_serializable_instances.d.ts#L22

interface EventHandlers {
  /**
   * Take action on data load.
   */
  onDataLoad: ({ layerId, dataId }: { layerId: string; dataId: string }) => void;
  /**
   * Take action on data load end.
   */
  onDataLoadEnd: ({
    layerId,
    dataId,
    resultMeta,
  }: {
    layerId: string;
    dataId: string;
    resultMeta: ResultMeta;
  }) => void;
  /**
   * Take action on data load error.
   */
  onDataLoadError: ({
    layerId,
    dataId,
    errorMessage,
  }: {
    layerId: string;
    dataId: string;
    errorMessage: string;
  }) => void;
}

@thomasneirynck thomasneirynck self-assigned this Feb 9, 2021
@thomasneirynck
Copy link
Contributor Author

Closing. with #76237 enablea the loading-spinner for tile-layers, and the setEventHandlers method allows for monitoring loading-state.

Maps automation moved this from To do to Done (current version) Mar 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation enhancement New value added to drive a business result v7.12.0 v8.0.0
Projects
No open projects
Maps
  
Done (current version)
Development

No branches or pull requests

3 participants