Skip to content

Configuring slider keys does not have any effect #203

@oscarlorentzon

Description

@oscarlorentzon

mapillary-js version: 1.5.0

Steps to Reproduce Behavior

  1. Create a viewer with the slider configured:
var mly = new Mapillary.Viewer(
    "mly",
    "<clientId>",
    "<foregroundKey>",
    {
        "cover": false,
        "imageplane": false,
        "direction": false,
        "sequence": false,
        "slider": {
            keys: {
                background: "<foregroundKey>",
                foreground: "<foregroundKey>",
            },
            initialPosition: 1.0,
        }
    }
);

Expected Behavior

Slider UI element is shown and it it possible to use the slider.

Actual Behavior

No slider is shown

Additional information

Introduced in RxJS 4 to RxJS 5 migration.

Generic zip method does not seem to handle the array of Observables and project overload properly.

Resolved by changing this

.zip<ISliderNodes>(
[
this._navigator.graphService.node$(configuration.keys.background),
this._navigator.graphService.node$(configuration.keys.foreground),
],
(background: Node, foreground: Node): ISliderNodes => {
return { background: background, foreground: foreground };
})
to this:

.zip<NewNode, NewNode>(
    this._navigator.graphService.node$(configuration.keys.background),
    this._navigator.graphService.node$(configuration.keys.foreground))
.map<ISliderNodes>(
    (nodes: [NewNode, NewNode]): ISliderNodes => {
        return { background: nodes[0], foreground: nodes[1] };
    })

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions