Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Map is not loading , No errors in console. Any help? #34

Open
adorearun opened this issue Oct 16, 2019 · 1 comment
Open

Map is not loading , No errors in console. Any help? #34

adorearun opened this issue Oct 16, 2019 · 1 comment

Comments

@adorearun
Copy link

`import React, { Component } from 'react';
import { ReactBingmaps } from 'react-bingmaps';

class BingMaps extends Component {

render() {
    return (

        <div>
            sdfsdf

<ReactBingmaps

          bingmapKey = "KEY"
          center = {[13.0827, 80.2707]}
         
         
        > 
        </ReactBingmaps>
            </div>

    )
}

}

export default BingMaps;

`

@nickvanhooydonk
Copy link

nickvanhooydonk commented Nov 26, 2019

The Bing Maps standard opens on 100%:
.react-bingmaps{ width: 100%; height: 100% }

The % unit is always relative to some value. I guess that in your case the % is relative to another div that has no explicit height set, so it defaults to 'auto'.

Creating an wrapper div with an explicit height fixed my case.
So my render function:
<div className={styles.container}> <ReactBingmaps bingmapKey="myKey" /> </div>

And my scss file:
.container { height: 500px; }

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants