Search code examples
javascriptmapshere-api

Javascript events using H.datalens.Provider


Are there any events to subscribe to using

H.datalens.Provider

? So one can know when all data has been loaded for example, or if there was an error.


Solution

  • I'm afraid not. There is an "update" event being triggered when the data gets updated (see https://developer.here.com/documentation/geovisualization/datalens/h-datalens-provider.html) but I do recall it triggering multiple times. Afaik there's no easy way to know the data has finished loading.

    A trick I've seen using is listening to the event and starting a timeout, resetting it every time a new update event gets triggered. When the timeout is finally able to execute, the updates are over. This is not by any means a good solution, but might be of help.