0

I am using react map gl to render maps in my react application. But the Maps rendered from react-map-gl are not taking the width after opening inspect and, sometimes not restoring back to normal after shrinking the window

This is my setting for the viewport,

 const mapStyle = {
        height: '100vh',
        width: '60vw',
        zoom: 15
    }

Please find the image below: The left side is reserved for showing extra information

At first, it works as expected

enter image description here

After opening a inspect and closing the sidebar, the map shrinks like this

enter image description here

enter image description here

1 Answers1

0

On which react-map-gl version are you? I noticed that in v7 height and width fields in viewState, former viewport, do not exist anymore. Not sure if related.

  • This does not provide an answer to the question. You can [search for similar questions](/search), or refer to the related and linked questions on the right-hand side of the page to find an answer. If you have a related but different question, [ask a new question](/questions/ask), and include a link to this one to help provide context. See: [Ask questions, get answers, no distractions](/tour) –  May 26 '22 at 23:50
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community May 27 '22 at 00:45