gis-ops / valhalla-app

This is the demo web app running on https://valhalla.openstreetmap.de
https://valhalla.openstreetmap.de
MIT License
163 stars 90 forks source link

[FEATURE] Hide Height-Graph Button in the bottom, and show only when user has selected any destination or source. #114

Closed inceptionabhishek closed 1 year ago

inceptionabhishek commented 1 year ago

Description

What kind of feature you are suggesting?

The height graph button is useful when we have selected any source and destination however if we don't select anything from the map and we still click on the button then it shows a blank rectangular div which I think is a bit out of context. Instead of showing the blank div, we can either show some text or pop-up to let the user know "how to use that feature(height graph)".

I think what we can do here is that if the user has not selected any points on the map, and tries to click on the height graph button then on the hover of the mouse button we can show them some text "what is this feature about or how to use it".

Like we have in the settings panel for showing info about costing options. And we can disable the button click until the user has not selected any points that can have a height graph.

Does it solve any problem?

It will help to overcome the confusions that might occur while using the height graph. It will also hide the unnecessary blank div when the user has not selected any points on the graph.

Screenshots

If we have not selected any points on the graph: -

image

It works fine when points are selected 👍

image

Additional information

No response

nilsnolde commented 1 year ago

Yes that's true, it might be better to disable it and show a tool info when hovering (also show it when it's enabled). The icon is pretty on point, but still better to have it confirmed with text.

inceptionabhishek commented 1 year ago

Yeah, that would be better!

inceptionabhishek commented 1 year ago

This issue is open for everyone, if they want to resolve this issue they can raise PR.

nomandhoni-cs commented 1 year ago

I was facing the same problem while clicking on the Heigh Graph button. I am already working on this issue, now I found out there is this issue already created in GitHub. Screenshot_53

Ideas

@nilsnolde @inceptionabhishek Any suggestions which idea will improve the user experience,

inceptionabhishek commented 1 year ago

@nomandhoni-cs Well, I my opinion you can show the text: "Height Graph" on mouse hover, and disable the icon till the user has not selected both waypoints. In your recent PR #126, you placed the text below the icon which I think looks gross. So, just make it hover text only. Thanks

nomandhoni-cs commented 1 year ago

@inceptionabhishek It was on hover, I didn't place that as permanent.

https://user-images.githubusercontent.com/92979541/225013684-80603d5d-b81b-4568-914f-2ac7a1342a41.mp4

nilsnolde commented 1 year ago

Not only waypoints have to be selected, an actual route has to be already computed. never mind, it's really the same thing..

IMO it's best to disable (i.e. not hide) the button where there's no route.

nabin-nath commented 1 year ago

@nilsnolde I tried to use hide the button when there are less than two directions, and show if more than or equal to 2, but the issue i am facing is Map is defined in componentDidMount, i was using redux and setting true of false in the controlSetting of the map, as the Map is in componentDidMount it is rendering only once, can you suggest me a simple way to do it?

Hers's the pr to this approach: https://github.com/gis-ops/valhalla-app/pull/140

Rohitkr2510 commented 1 year ago

I want to work on this issue. Please assign it to me.

nilsnolde commented 1 year ago

It’s done I think