question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

inline styles on the map container are breaking my view

See original GitHub issue
    container: {
      position: 'absolute',
      width: '100vw',
      height: '100vh'
    }

is causing the map to leave my container

it used to be

    container: {
      position: 'absolute',
      width: '100%',
      height: '100%'
    },

and it worked just fine.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:2
  • Comments:6

github_iconTop GitHub Comments

7reactions
tomjschustercommented, Oct 28, 2016

@kevinSuttle, it looks like you’re just changing the map style, but not the container style. Try including:

containerStyle={{position: 'relative'}}

as well.

6reactions
tomjschustercommented, Oct 26, 2016

You can override this through the Map component’s containerStyle prop:

const containerStyle = {position: 'absolute', width: '100%', height:'100%'}

<Map google={this.props.google} containerStyle={containerStyle}/>
Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I dynamically set style of a mapped element without ...
I'm trying to avoid manual entry of the entire set of key/values of 'ingredients', to allow updating the object without breaking the code....
Read more >
overflow-inline - CSS: Cascading Style Sheets - MDN Web Docs
The overflow-inline CSS property sets what shows when content overflows the inline start and end edges of a box. This may be nothing,...
Read more >
Inline Styling In React | Pluralsight
The best part is that it allows you to break a component into smaller, reusable components. Instead of putting all the logic into...
Read more >
Change a map's style | Mapbox GL JS
This example adds a clickable interface that enables a user to apply several different styles to the map. When the user clicks a...
Read more >
Adding Custom Styles - Tailwind CSS
This guide covers topics like customizing your design tokens, how to break out of those constraints when necessary, adding your own custom CSS,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found