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

feat(event): Event added to API for map ready #2510

Merged

Conversation

DamonU2
Copy link
Member

@DamonU2 DamonU2 commented Sep 25, 2024

Description

Added an API event to inform user when the map viewer is ready, for use outside of cgpv.init

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Tested using event to log map ID in the console
https://damonu2.github.io/geoview/

Checklist:

  • I have build (rush build) and deploy (rush host) my PR
  • I have connected the issues(s) to this PR
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have created new issue(s) related to the outcome of this PR is needed
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

This change is Reviewable

@DamonU2 DamonU2 requested a review from jolevesq September 25, 2024 16:33
@DamonU2 DamonU2 self-assigned this Sep 25, 2024
@DamonU2 DamonU2 force-pushed the map-ready-event-on-api branch from 15940e5 to 0a3ed74 Compare September 26, 2024 17:08
Copy link
Member

@jolevesq jolevesq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 2 of 4 files at r2, all commit messages.
Reviewable status: 2 of 4 files reviewed, 1 unresolved discussion (waiting on @DamonU2)


packages/geoview-core/src/api/api.ts line 61 at r2 (raw file):

  /**
   * Sets a map viewer in maps.

Missing JSDOC params. Put a bit more info to say were this is called to add and delete map. Plus a TODO to create get later (with huge impact on current users)

Copy link
Member

@jolevesq jolevesq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 2 of 4 files reviewed, 2 unresolved discussions (waiting on @DamonU2)


packages/geoview-core/src/core/app-start.tsx line 75 at r2 (raw file):

    // create a new map viewer instance and add it to the api
    // TODO: use store, remove the use of feature by viewer class and use state to gather values
    if (!(mapId in api.maps)) {

Even this check can be in api, what do you think

Copy link
Member

@jolevesq jolevesq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 2 of 4 files reviewed, 2 unresolved discussions (waiting on @DamonU2)


packages/geoview-core/src/core/app-start.tsx line 75 at r2 (raw file):

Previously, jolevesq (Johann Levesque) wrote…

Even this check can be in api, what do you think

or will it create problem.... it can stay as is and we can deal when we have the getter

Copy link
Member Author

@DamonU2 DamonU2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 2 of 4 files reviewed, 2 unresolved discussions (waiting on @jolevesq)


packages/geoview-core/src/core/app-start.tsx line 75 at r2 (raw file):

Previously, jolevesq (Johann Levesque) wrote…

or will it create problem.... it can stay as is and we can deal when we have the getter

We can move all of this to a function in the API or leave it as is. We need the check here so that we don't create a MapViewer if we don't need it, but moving all of this to the API makes sense too.

@DamonU2 DamonU2 force-pushed the map-ready-event-on-api branch from 0a3ed74 to 6805424 Compare September 26, 2024 18:18
Copy link
Member Author

@DamonU2 DamonU2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 2 of 4 files reviewed, 2 unresolved discussions (waiting on @DamonU2 and @jolevesq)


packages/geoview-core/src/api/api.ts line 61 at r2 (raw file):

Previously, jolevesq (Johann Levesque) wrote…

Missing JSDOC params. Put a bit more info to say were this is called to add and delete map. Plus a TODO to create get later (with huge impact on current users)

Done.

@DamonU2 DamonU2 force-pushed the map-ready-event-on-api branch from 6805424 to ac59566 Compare September 26, 2024 18:19
@DamonU2 DamonU2 force-pushed the map-ready-event-on-api branch from ac59566 to 2a26865 Compare September 26, 2024 18:32
Copy link
Member

@jolevesq jolevesq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 4 files at r2, 1 of 1 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @DamonU2)

@jolevesq jolevesq merged commit 2a03afa into Canadian-Geospatial-Platform:develop Sep 26, 2024
6 checks passed
@DamonU2 DamonU2 deleted the map-ready-event-on-api branch December 3, 2024 16:40
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

Successfully merging this pull request may close these issues.

2 participants