-
Notifications
You must be signed in to change notification settings - Fork 4
Add map state persistance #3379
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Ayoub LABIDI <[email protected]>
| return { | ||
| zoom: networkMapRef.current?.getCurrentViewState()?.zoom, | ||
| center: [ | ||
| networkMapRef.current?.getCurrentViewState()?.center.lng, | ||
| networkMapRef.current?.getCurrentViewState()?.center.lat, | ||
| ] as [number, number], | ||
| filteredNominalVoltages: filteredNominalVoltages, | ||
| }; |
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.
call getCurrentViewState() only once
Plus, casting "as [number, number]" here is hiding the problem where "networkMapRef.current?.getCurrentViewState()" is nullish, handle it properly ?
Maybe reset to default positions if no ref is found (should not happen though)
Signed-off-by: Ayoub LABIDI <[email protected]>
Signed-off-by: Ayoub LABIDI <[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.
Test OK, console warning OK
Signed-off-by: Ayoub LABIDI <[email protected]>
4985fbe to
e154693
Compare
Signed-off-by: Ayoub LABIDI <[email protected]>
ba3a33e to
dac0c41
Compare
|



No description provided.