-
Notifications
You must be signed in to change notification settings - Fork 3
zoom to all fiscal polygons, not only current year, add helper methods to handle activity boundaries #584
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
Conversation
|
} | ||
}; | ||
|
||
const result = (component as any).mapFiscalActivities(response, fiscal); |
There was a problem hiding this comment.
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', { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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[] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any
again
No description provided.