-
Notifications
You must be signed in to change notification settings - Fork 7
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
WAITP-1222: Marker layer #4686
WAITP-1222: Marker layer #4686
Conversation
|
||
export const MarkerLayer = () => { | ||
// set the map default overlay if there isn't one selected | ||
useDefaultMapOverlay(); |
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.
This effect could go anywhere and I'm not really sure where it should go. I put it here so that it's close to where the report data is used.
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.
I agree it could go anywhere. I almost feel like it should be built into the links, but then it's possible a link could be navigated to in some way without a default overlay code being in it (e.g directly entering the url). Is useDefaultMapOverlay
used anywhere else? Could it possibly be contained in the map component?
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.
This is a massive amount of effort, nice work! I have a few questions but in general it's looking good, and awesome to be hitting this point in the project!
measureData: measureDataResponse, | ||
}; | ||
}; | ||
|
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.
I don't see anything wrong with this, but I guess it opens up the question, should we be doing this on the frontend, or should the endpoint be returning data the correct way? Or is this because dashboard reports and map overlay reports are both using the report
endpoint?
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.
Yes good question. I just had a chat to Ethan about this and he said that this could be done on the backend but it would be messy because we use the report route is used fro both the map overlays and the dashboard items.
packages/tupaia-web/src/features/Map/MapOverlaySelector/DesktopMapOverlaySelector.tsx
Show resolved
Hide resolved
@@ -49,6 +49,7 @@ const Heading = styled(Typography).attrs({ | |||
|
|||
const Container = styled(MaxHeightContainer)` | |||
border-radius: 0 0 5px 5px; |
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.
I wonder if we should save this border radius value somewhere (just the 5px
) since it gets used a lot. I know not strictly part of this PR, but just something I thought of
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.
hmmm we could do but I wonder if it would actually be helpful. I don't think that is something that would change in a theme for example.
|
||
export const MarkerLayer = () => { | ||
// set the map default overlay if there isn't one selected | ||
useDefaultMapOverlay(); |
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.
I agree it could go anywhere. I almost feel like it should be built into the links, but then it's possible a link could be navigated to in some way without a default overlay code being in it (e.g directly entering the url). Is useDefaultMapOverlay
used anywhere else? Could it possibly be contained in the map component?
packages/tupaia-web/src/features/Map/MarkerLayer/MarkerLayer.tsx
Outdated
Show resolved
Hide resolved
packages/tupaia-web/src/features/Map/MarkerLayer/useDefaultMapOverlay.ts
Outdated
Show resolved
Hide resolved
import { MapOverlayGroup, ProjectCode, EntityCode } from '../../types'; | ||
|
||
// When the map overlay groups change, update the default map overlay | ||
export const useDefaultMapOverlay = ( |
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.
I ended up refactoring this a little to try and make it clearer and moved it to the map component so it's easier to find.
entitiesData: any; | ||
serieses: any; | ||
hiddenValues: any; | ||
interface processMeasureDataProps { |
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.
/
interface processMeasureDataProps { | |
interface ProcessMeasureDataProps { |
} | ||
export const processMeasureData = ({ | ||
measureData, | ||
entitiesData, | ||
serieses, | ||
hiddenValues, | ||
}: processMeasureData) => { | ||
}: processMeasureDataProps) => { |
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.
}: processMeasureDataProps) => { | |
}: ProcessMeasureDataProps) => { |
Nice work, thanks for doing all the types in this too! |
* Working legend, grouped columns * Apply location values * Tidy up * Styled column groups * Tiy up files * Add in hidden column titles * Update hidden column title and config types * Generate types * Move the buttons * WAITP-1222: Marker layer (#4686) * setup map entites * wip * wip * re organise project view * mobile search layout * polygon layer * map animation * fix mini map * Update Dashboard.tsx * merging * map overlay data * add Map overlays feature folder * useEntitiesWithLocation * typescript * remove test code * Update InteractivePolygon.tsx * set up * fix api * marker layer * Update types.d.ts * update map layout * wip map overlays * revert map control layout * Update useEntities.ts * copy lesmis * wip * Update MapOverlayList.tsx * default map overlay * radius overlays * navigate to dashboard * fix scroll * measure level * refactor marker layer * refactor useDefaultMapOverlay * types * useEntitiesByMeasureLevel * Update MapOverlaysRoute.ts * fix active entity * Update MarkerLayer.tsx * add comments * Update processMeasureData.ts * refactor useDefaultMapOverlay * Fix merge conflicts * Fix conflict errors --------- Co-authored-by: Tom Caiger <caigertom@gmail.com>
* WAITP-1231 Working table * WIP * Update Matrix.tsx * Fix linting errors * convert to use context * Update hooks * Fix issues * Reorganise files * reorganise context * Working table * Remove enlarged cell modal file * Working modal * Tidy up * Update MatrixCell.tsx * Tidy up hover * Add cell handling for markdown * fix types * WAITP-1231 fixes * Delete types.d.ts * Update index.ts * Fix type error * Waitp 1231 base matrix part 2 (#4714) * Working legend, grouped columns * Apply location values * Tidy up * Styled column groups * Tiy up files * Add in hidden column titles * Update hidden column title and config types * Generate types * Move the buttons * WAITP-1222: Marker layer (#4686) * setup map entites * wip * wip * re organise project view * mobile search layout * polygon layer * map animation * fix mini map * Update Dashboard.tsx * merging * map overlay data * add Map overlays feature folder * useEntitiesWithLocation * typescript * remove test code * Update InteractivePolygon.tsx * set up * fix api * marker layer * Update types.d.ts * update map layout * wip map overlays * revert map control layout * Update useEntities.ts * copy lesmis * wip * Update MapOverlayList.tsx * default map overlay * radius overlays * navigate to dashboard * fix scroll * measure level * refactor marker layer * refactor useDefaultMapOverlay * types * useEntitiesByMeasureLevel * Update MapOverlaysRoute.ts * fix active entity * Update MarkerLayer.tsx * add comments * Update processMeasureData.ts * refactor useDefaultMapOverlay * Fix merge conflicts * Fix conflict errors --------- Co-authored-by: Tom Caiger <caigertom@gmail.com> --------- Co-authored-by: Tom Caiger <caigertom@gmail.com>
* setup map entites * wip * wip * re organise project view * mobile search layout * polygon layer * map animation * fix mini map * Update Dashboard.tsx * merging * map overlay data * add Map overlays feature folder * useEntitiesWithLocation * typescript * remove test code * Update InteractivePolygon.tsx * set up * fix api * marker layer * Update types.d.ts * update map layout * wip map overlays * revert map control layout * Update useEntities.ts * copy lesmis * wip * Update MapOverlayList.tsx * default map overlay * radius overlays * navigate to dashboard * fix scroll * measure level * refactor marker layer * refactor useDefaultMapOverlay * types * useEntitiesByMeasureLevel * Update MapOverlaysRoute.ts * fix active entity * Update MarkerLayer.tsx * add comments * Update processMeasureData.ts * refactor useDefaultMapOverlay
* WAITP-1231 Working table * WIP * Update Matrix.tsx * Fix linting errors * convert to use context * Update hooks * Fix issues * Reorganise files * reorganise context * Working table * Remove enlarged cell modal file * Working modal * Tidy up * Update MatrixCell.tsx * Tidy up hover * Add cell handling for markdown * fix types * WAITP-1231 fixes * Delete types.d.ts * Update index.ts * Fix type error * Waitp 1231 base matrix part 2 (#4714) * Working legend, grouped columns * Apply location values * Tidy up * Styled column groups * Tiy up files * Add in hidden column titles * Update hidden column title and config types * Generate types * Move the buttons * WAITP-1222: Marker layer (#4686) * setup map entites * wip * wip * re organise project view * mobile search layout * polygon layer * map animation * fix mini map * Update Dashboard.tsx * merging * map overlay data * add Map overlays feature folder * useEntitiesWithLocation * typescript * remove test code * Update InteractivePolygon.tsx * set up * fix api * marker layer * Update types.d.ts * update map layout * wip map overlays * revert map control layout * Update useEntities.ts * copy lesmis * wip * Update MapOverlayList.tsx * default map overlay * radius overlays * navigate to dashboard * fix scroll * measure level * refactor marker layer * refactor useDefaultMapOverlay * types * useEntitiesByMeasureLevel * Update MapOverlaysRoute.ts * fix active entity * Update MarkerLayer.tsx * add comments * Update processMeasureData.ts * refactor useDefaultMapOverlay * Fix merge conflicts * Fix conflict errors --------- Co-authored-by: Tom Caiger <caigertom@gmail.com> --------- Co-authored-by: Tom Caiger <caigertom@gmail.com>
* setup map entites * wip * wip * re organise project view * mobile search layout * polygon layer * map animation * fix mini map * Update Dashboard.tsx * merging * map overlay data * add Map overlays feature folder * useEntitiesWithLocation * typescript * remove test code * Update InteractivePolygon.tsx * set up * fix api * marker layer * Update types.d.ts * update map layout * wip map overlays * revert map control layout * Update useEntities.ts * copy lesmis * wip * Update MapOverlayList.tsx * default map overlay * radius overlays * navigate to dashboard * fix scroll * measure level * refactor marker layer * refactor useDefaultMapOverlay * types * useEntitiesByMeasureLevel * Update MapOverlaysRoute.ts * fix active entity * Update MarkerLayer.tsx * add comments * Update processMeasureData.ts * refactor useDefaultMapOverlay
* WAITP-1231 Working table * WIP * Update Matrix.tsx * Fix linting errors * convert to use context * Update hooks * Fix issues * Reorganise files * reorganise context * Working table * Remove enlarged cell modal file * Working modal * Tidy up * Update MatrixCell.tsx * Tidy up hover * Add cell handling for markdown * fix types * WAITP-1231 fixes * Delete types.d.ts * Update index.ts * Fix type error * Waitp 1231 base matrix part 2 (#4714) * Working legend, grouped columns * Apply location values * Tidy up * Styled column groups * Tiy up files * Add in hidden column titles * Update hidden column title and config types * Generate types * Move the buttons * WAITP-1222: Marker layer (#4686) * setup map entites * wip * wip * re organise project view * mobile search layout * polygon layer * map animation * fix mini map * Update Dashboard.tsx * merging * map overlay data * add Map overlays feature folder * useEntitiesWithLocation * typescript * remove test code * Update InteractivePolygon.tsx * set up * fix api * marker layer * Update types.d.ts * update map layout * wip map overlays * revert map control layout * Update useEntities.ts * copy lesmis * wip * Update MapOverlayList.tsx * default map overlay * radius overlays * navigate to dashboard * fix scroll * measure level * refactor marker layer * refactor useDefaultMapOverlay * types * useEntitiesByMeasureLevel * Update MapOverlaysRoute.ts * fix active entity * Update MarkerLayer.tsx * add comments * Update processMeasureData.ts * refactor useDefaultMapOverlay * Fix merge conflicts * Fix conflict errors --------- Co-authored-by: Tom Caiger <caigertom@gmail.com> --------- Co-authored-by: Tom Caiger <caigertom@gmail.com>
Issue #: WAITP-1222: Marker layer
Changes:
Screenshots: