It would be great if we could start deciding what set of UIs should be enabled by default in mapillary-js
. Below is my take on what's essential for the initial version. Bear in mind that some of these could be disabled, with an option flag when initializing the viewer.
Current list of UI/features we should take into consideration:
- AttributionUI - Displays attribution for the user, links to mapillary.com
- CoverUI - Downloads a
320px
photo, sets it as a background cover above all the other UI elements in the viewer container. Displays a button which will activate other UIs and will start fetching data in the future (doesn't work yet).
- DetectionsUI - Makes an API call to
/or
endpoint for the given photo, displays rectangles with detected traffic signs on top of the viewer.
- EventUI - Emits various events, to which
mapillary-js
user can hook into
- GlUI - The heart of
mapillary-js
π
- KeyboardUI - Allows navigation using the keyboard
- LoadingUI - Display loading progress as a 2px bar in the top of the viewer.
- SimpleCacheUI - Caches the fetched data in case the user returns to the photo previously visited
- SimpleNavUI - Displays direction arrows in various corners/at various edges of the viewer.
- SimplePlayUI - Allows to play/stop playing of sequences
- SimpleUI - Canvas based viewer
Proposition: I think, we should have a set of sane defaults for most uses. Let's start with the most important UIs: GlUI
and SimpleUI
. I would say that we should also have GlUI enabled by default, and SimpleUI should be its' fallback in case the system where mapillary-js
is displayed doesn't support WebGL. Next, DirectionsUI
should always be displayed, but we should provide means to toggle it. For the SimpleUI
, when no WebgGL has been detected, we fall back to SimpleNavUI
, since this viewer won't display panoramas. CoverUI
should be also enabled by default, since it prevents loading unnecessary data and handles the scenario when multiple viewers are within the one view. AttributionUI
is essential too as we want to give credit to the community (username links to the profile) and there is also a link to the photo on mapillary.com. We should display loading progress by default through LoadingUI
. SimpleCacheUI
should be enabled by default too, so we don't make unnecessary requests. EventUI
is a no brainer, we want everyone to be able to hook into the events without doing any extra work on their side.
Proposed essential UIs/features: GlUI
, CoverUI
, LoadingUI
, Directions
, SimpleCacheUI
- SimpleUI
would be used only after internal feature check.
Regarding optional UIs⦠KeyboardUI
is a tricky one, since the library consumer might have event handlers attached to keys already. I would say this should be enabled when specified. Last, SimplePlayUI
, this is a really cool feature, but I'm totally unsure whether it should be enabled by default? mly.Viewer.play()
is an appealing option, though.
WDYT?