Skip to content

Conversation

yzlucas
Copy link
Collaborator

@yzlucas yzlucas commented Apr 15, 2025

No description provided.

@yzlucas yzlucas requested review from ssylver93 and dhlevi April 15, 2025 18:00
@bcgov bcgov deleted a comment from sonarqubecloud bot Apr 15, 2025
@bcgov bcgov deleted a comment from sonarqubecloud bot Apr 15, 2025
Copy link

@yzlucas yzlucas changed the title zoom to all fiscal polygons, not only current year zoom to all fiscal polygons, not only current year, add helper methods to handle activity boundaries Apr 15, 2025
}
};

const result = (component as any).mapFiscalActivities(response, fiscal);
Copy link
Contributor

Choose a reason for hiding this comment

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

Try to avoid using "any". You can always define a type and use that instead so it's explicit and we're not just letting anything through. This can also help with error checking

(this.map.zoomControl as L.Control.Zoom).setPosition('topright');
(this.map.zoomControl).setPosition('topright');

L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
Copy link
Contributor

Choose a reason for hiding this comment

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

Would be good to parameterize this. It isn't likely to change much or at all, but just in case. Should we be sticking with openstreetmap or using DataBC BC basemaps?

);
}

private mapActivityBoundary(boundary: any, activity: any): any {
Copy link
Contributor

Choose a reason for hiding this comment

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

You have a could to types here defined. boundary object, whatever that is, or the manually defined type, or null. Rather than any define these types and set the return to be : type | type | null vs : any

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sounds good, I will create some objects in model.ts to store them. Will go through the application to use defined type with updated method signature. I will create a separate to address them

}));
}

private handleActivitiesResponse(allActivities: any[]): void {
Copy link
Contributor

Choose a reason for hiding this comment

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

any again

);
}

private mapFiscalActivities(response: any, fiscal: any): any[] {
Copy link
Contributor

Choose a reason for hiding this comment

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

any again

@yzlucas yzlucas merged commit b425593 into main Apr 15, 2025
8 checks passed
@yzlucas yzlucas deleted the fiscal-map-fix branch April 15, 2025 20:43
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.

3 participants