milespratt / bingmaps-react

An easy to use Bing Maps React component.
https://bingmaps-react.netlify.app
MIT License
22 stars 19 forks source link

Map doesn't render when passing options? #47

Closed bulent-eroglu closed 2 years ago

bulent-eroglu commented 2 years ago

This is the exact component I am trying to run, on initial render it doesn't render anything, unless I go into my IDE and change something and save it.

However , it seems to render correctly if I only pass my bing map key into it..

lat and lng are props which come from parent component but I also tested this with hard coded values, same result

interface Props {
  lat: number
  lng: number
}

export default function BingMap({ lat, lng }: Props) {
  return (
    <BingMapsReact
      pushPins={[
        {
          center: { latitude: lat, longitude: lng },
        },
      ]}
      bingMapsKey={process.env.NEXT_PUBLIC_BING_MAPS_KEY}
      mapOptions={{
        navigationBarMode: 'square',
      }}
      viewOptions={{
        center: { latitude: lat, longitude: lng },
        zoom: 17,
      }}
    />
  )
}
selcuktoklucu commented 2 years ago

What is the error you are seeing in your console, @bulent-eroglu ?

milespratt commented 2 years ago

No update from original reporter since January. Closing as stale.