Skip to content

DOM elements (nav arrows, attribution etc) disappear when viewer div height is set to auto #264

@oscarlorentzon

Description

@oscarlorentzon

mapillary-js version: 2.6.0

Steps to Reproduce Behavior

  1. Create a viewer with an automatic height (e.g. with a 4:3 fixed aspect ratio using padding-bottom as below):
<!DOCTYPE html>
<html>
<head>
    <script src='https://unpkg.com/mapillary-js@2.6.0/dist/mapillary.min.js'></script>
    <link href='https://unpkg.com/mapillary-js@2.6.0/dist/mapillary.min.css' rel='stylesheet' />

    <style>
        body { margin:0; padding:0; }
        #mly { position:absolute; width:100%; padding-bottom:75%; }
    </style>
</head>
<body>
    <div id='mly'></div>
    <script>
        var viewer = new Mapillary.Viewer(
            "mly",
            "<client-id>",
            "<image-key>",
            { component: { cover: false } });

        window.addEventListener("resize", function() { viewer.resize(); });
    </script>
</body>
</html>

Expected Behavior

All DOM elements are visible.

Actual Behavior

No DOM elements are visible.

Additional information

Introduced in 360c2d2

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions