-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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] data load event handlers #49373
Conversation
Pinging @elastic/kibana-gis (Team:Geo) |
💚 Build Succeeded |
@elasticmachine merge upstream |
Here's a draft PR using this new API: #49589 To meet our use case I created a Anyway, implementation was pretty seamless (thank-you! 🙂) , only two pieces of feedback:
Other than that everything looks 👍 Thanks for the added functionality and quick turn-around on this! |
💚 Build Succeeded |
Thanks, fixed
There was an uncaught error "Uncaught (in promise) TypeError: Cannot read property 'length' of undefined" resulting in onDataLoadEnd not getting called for that layer. That issue has been resolved. |
💚 Build Succeeded |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome. One small piece of feedback:
I would wrap the 3rd argument of the callback, featuresCount
, into an object. The contents of this argument depend on the layer-type (e.g. tile-layer could have different "completion"-arguments than a heatmap-layer than a vector-layer). featuresCount
only applies to vector-layer.
wrt @spong
Having a global loading flag makes things a bit easier to digest on our end.
I'd agree with that, but I'd hesitate to put this global-flag into a first pass at this. It's hard to create a global data-load flag and have it work reliably in Maps. It's not just the data-loading itself, but detecting map-movements, tile-loading, ... those would all have to be wrapped up into this.
@thomasneirynck @spong |
💚 Build Succeeded |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated #49589 against the latest that introduces the resultMeta
object and all is good -- LGTM 👍
* [Maps] data load event handlers * update readme featuresCount to reflect variable name * fix exception with EMS_TMS onDataLoadEnd * wrap featuresCount in resultMeta object so different layer types can return different results
fixes #49236
This PR adds
eventHandlers
parameter toMapEmbeddableFactory.createFromState
allowing consumers to register callbacks foronDataLoad
,onDataLoadEnd
,onDataLoadError
.