React-google-maps: The example-"simple map" shows nothing in my project

Created on 11 May 2017  路  6Comments  路  Source: tomchentw/react-google-maps

How to use these components? Anybody can show me a full simple project?

Most helpful comment

Same here, I followed all steps and my page shows nothing

All 6 comments

Same here, I followed all steps and my page shows nothing

@yazamiko in developer tools did you check whether map is downloading ?
If it is downloading then you might have to adjust styles.

did you specify the width and height of the container?

I had the same issue, I inspected the DOM and found that the div containing my map had an inline style of position: relative - this was causing it to not display anything. Hence why you also have no errors in the console. So, check your CSS.

For me, the map is rendered but it has a style problem.

I use display: flex to solve it.

<div style="display: flex;">
    <div style="width: 300px; height: 300px;">
    </div>
    <div>
         <myGoogleMap
               containerElement={
                   <div style={{ height: '100%' }} />
               }
               mapElement={
                   <div style={{ height: '100%' }} />
               }
                markers={markers}
          />
    </div>
</div>

Try the new v8.0.0 with new docs:
https://tomchentw.github.io/react-google-maps/

Was this page helpful?
0 / 5 - 0 ratings