alex3165 / react-mapbox-gl

A React binding of mapbox-gl-js
http://alex3165.github.io/react-mapbox-gl/
MIT License
1.93k stars 536 forks source link

Invalid LngLat object error when zooming on markers #1000

Open valclark1 opened 2 years ago

valclark1 commented 2 years ago

react-mapbox-gl version: 5.1.1

const Mapbox = ReactMapboxGl({
  minZoom: 6,
  accessToken,
  attributionControl: false,
  doubleClickZoom: false,
});
      <Mapbox
        style="mapbox://styles/mapbox/light-v10?optimize=true"
        containerStyle={{
          flex: 1,
          height: "100%",
          width: "100%",
        }}
        flyToOptions={{
          speed: 0.1,
          curve: 0,
        }}
        onDrag={onDrag}
        zoom={[6]}
        center={center}
        onStyleLoad={onStyleLoad}
        renderChildrenInPortal
      >
        <JobMarker
          anchor="bottom"
          data={[]}
          onClick={onMarkerClick}
          selected={data}
        />
      </Mapbox>

If I remove the initial zoom on the Mapbox component everything works fine. But with it added, whenever I zoom I get the following error:

Screen Shot 2022-03-23 at 8 31 20 AM