Map doesn't seam to load when passing in variables
I am trying to plot the point of the ISS on the map. The data I am getting back from that API is a string which I am converting into a number. the map loads but with a grey screen and with the marker at the top left corner if i replace the vars with the numbers it works?
From what I can see in React looing in the console the map props centre is correct with the numbers but the map state centre is null
I have tried variations of this
const { latitude,longitude } = this.props.iss_position let lat = Number(latitude); let lon = Number(longitude) const map = ( <Map center={[lat, lon]} defaultZoom={12} width={600} height={400}> {/* <Marker anchor={[50.879, 4.6997]} payload={1} onClick={this.handleMarkerClick} /> */} </Map> )
thanks
Hi, it's hard to help without some way of reproducing this. Can you provide a codesandbox or equivalent place where I could test it? Alternatively, add some debugger or console.log statements and make sure all numbers are correct.
I originally thought there might be an issue when using center together with defaultZoom, but a quick test revealed that not to be true.