ramp4-pcar4 / ramp4-pcar4

RAMP 4 - The Reusable Accessible Mapping Platform, fourth major version
https://ramp4-pcar4.github.io/ramp4-pcar4/main/docs/
Other
17 stars 22 forks source link

Mapnav Schema Lies / Actual Bug #2118

Closed mohsin-r closed 1 week ago

mohsin-r commented 9 months ago

Description

While working on the mapnav section of the config editor, I have found a problem. However, I am not sure if the schema is wrong and the code is right or the schema is right and the code is wrong, so this can be edited whenever the expert has taken a look.

The problem is that in the mapnav's items array, you can choose to include or exclude the zoom buttons and you can also specify via the zoomButton option whether you want zoom buttons or a zoom slider. However, no matter what combination of config I choose, the zoom buttons always show up, and they always show up as buttons (no slider).

Digging through the RAMP4 code, it indeed appears that zoom buttons will appear in every config, based on this code.

Environment

Expected behavior

The zoom buttons/slider should appear when configured or the schema should be corrected to tell the truth.

Actual behavior

The zoom buttons always appear.

Possible solution

Correct the schema or implement configurable zoom buttons/slider.

james-rae commented 9 months ago

Looks like nothing ever reads the zoomOption config nugget, and I can't see any "slider" controls written in Vue (maybe they are there and hiding)?

So a couple of things I can propose:

  1. Mark the zoomOption as "not implemented" in the schema. Open a new issue or discussion to consider having a "slider" mode. If we decide to do it, we still have the schema structure to use. If we decide not to, we depreciate and remove that schema nugget.
  2. Decide if zoom controls should be optional / removable. I think you can do it via mouse & keyboard so doesn't break stuff. If yes, have the zoom value in items start being respected. Otherwise remove the zoom value from the schema's enum of choices.