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

[BUG] Map Init not synch #2380

Open
1 task done
jolevesq opened this issue Jul 17, 2024 · 0 comments · May be fixed by #2546
Open
1 task done

[BUG] Map Init not synch #2380

jolevesq opened this issue Jul 17, 2024 · 0 comments · May be fixed by #2546
Assignees

Comments

@jolevesq
Copy link
Member

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

The mapinit callback is out of sync if we have geoCore layer type in the configuration. When this is the case, the mapinit callback is triggered but the array of layers is empty so this can be problematic for developers who are using event in the callback.

Expected Behavior

With geoCore layer, there is two async call one to get info and build the geoviewLAyer ans the other one to build the layer itself. We need to make sure we await on the geoCore call so the map init is not triggered before.

Steps To Reproduce

  1. https://canadian-geospatial-platform.github.io/geoview/public/demo-function-event.html
  2. Make sure a geocore layer is in function-event.json
 {
        "geoviewLayerType": "geoCore",
        "geoviewLayerId": "f4c51eaa-a6ca-48b9-a1fc-b0651da20509"
      },
  1. Remove timeout in app.tsx promiseInitMap
  2. Run the page and see some events will not be triggered because cgpv.api.maps['Map1'].layer.getGeoviewLayers() will be empty
  3. Run with timeout and see cgpv.api.maps['Map1'].layer.getGeoviewLayers() is not empty anymore

Anything else?

No response

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

Successfully merging a pull request may close this issue.

2 participants