-
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
get current location for overview map center, put a marker there #1242
Conversation
Signed-off-by: Steve Cassidy <[email protected]>
Have a strange issue where it worked once but doesn't seem to work every time |
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.
Haven't tested, just spying code.
type: 'Feature', | ||
geometry: { | ||
type: 'Point', | ||
coordinates: map_center, |
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.
is this safe if data is undefined - what's the behaviour?
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.
Have put a guard around this.
Signed-off-by: Steve Cassidy <[email protected]>
Signed-off-by: Steve Cassidy <[email protected]>
Signed-off-by: Steve Cassidy <[email protected]>
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.
Works well after discussed changes re: race conditions.
Would recommend some refactoring when we visit it again to do with error conditions and not relying on react query isLoading to check if something is happening 'for the first time' - would prefer refs to track this if needed.
Get current location for overview map center
JIRA Ticket
None
Description
The overview map had a fixed center point somewhere in Africa. More useful to move it
to the current location.
Proposed Changes
How to Test
Open a notebook with geo-locations (BSS) and view the Map. See the cross at your current location.
Move the map, click the circle 'center map' button and see it center the map on your location.
Checklist