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

Adding an embedded map "fully started" event? #58

Open
ZakarFin opened this issue Dec 2, 2024 · 1 comment
Open

Adding an embedded map "fully started" event? #58

ZakarFin opened this issue Dec 2, 2024 · 1 comment

Comments

@ZakarFin
Copy link
Member

ZakarFin commented Dec 2, 2024

We should probably add some event/mechanism for RPC-developers to know when the map has been started as published. Currently map layers are added asynchronously (due to DescribeLayer calls etc) so they might not be on the map when the RPC-client connects to the map. One way of detecting this is polling the getAllLayers() RPC-function and comparing it to some predefined expected value, but it's not a very clean way of doing this.

Options might be something like adding a new event OR not connecting the RPC before the map is fully loaded (might be better to do this).

@ZakarFin
Copy link
Member Author

ZakarFin commented Dec 2, 2024

Looks like getAllLayers() uses MapLayerService: https://github.com/oskariorg/oskari-frontend/blob/2.13.2/bundles/mapping/mapmodule/AbstractMapModule.js#L2324 instead of map state so it can't be used for polling. The getCurrentState() uses state so maybe that could be used for polling: https://github.com/oskariorg/oskari-frontend/blob/2.13.2/bundles/framework/rpc/instance.js#L383

Still not ideal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant