Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Uncaught TypeError: Cannot read properties of null (reading 'point') #2336

Open
force9493 opened this issue Jan 8, 2024 · 4 comments
Open
Labels

Comments

@force9493
Copy link

force9493 commented Jan 8, 2024

Description

I have installed react-map-gl and maplibre-gl in my react project.
I displayed map correctly. Also, I zoomed the map and moved several times.
In this case, I can get the following errors.

Screenshot at Jan 08 09-03-42

How can I fix this error?

Expected Behavior

When I use mapbox-gl and react-map-gl, there are no such errors. I want to get the same result when using maplibre-gl as well.

Steps to Reproduce

This is the source code that I used.

import Map from 'react-map-gl/maplibre';
const MapContainer = () => {
...

return (
    <Map 
          mapStyle={mapStyle}
          initialViewState={{
            latitude: initViewport.latitude,
            longitude: initViewport.longitude,
            zoom: initViewport.zoom,
            pitch: initViewport.pitch,
            bearing: initViewport.bearing,
          }}
          maxBounds={initViewport.maxBounds}
          maxZoom={initViewport.maxZoom}
          minZoom={initViewport.minZoom} />
);

};

Environment

Framework version: react-map-gl@7.1.7
Map library: maplibre-gl@3.3.1
Browser: Chrome 98.0
OS: Windows, Mac

Logs

No response

@force9493 force9493 added the bug label Jan 8, 2024
@force9493
Copy link
Author

Hi, everyone.
Please help me if you have ever met this error.

@Pessimistress
Copy link
Collaborator

We cannot reproduce your issue with the code provided, please create a sandbox.

Issues are for reporting bugs in this library. If you are not sure where the problem is, use Discussions.

@force9493
Copy link
Author

force9493 commented Jan 17, 2024

@Pessimistress Thanks for your reply.
You can easily test in the following codesandbox URL (https://codesandbox.io/p/sandbox/react-map-gl-maplibre-gl-forked-rqy9f9). Please check that and tell me your suggestion.
When zooming the buildings(especially corners) of the map, you can see the following errors.

image

@Pessimistress
Copy link
Collaborator

Thanks. I can reproduce the error, but as far as I can tell the error originates in maplibre-gl's renderer. You can try your map style with maplibre-gl directly (without React) and if the issue persists, you should report it to Maplibre.

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

No branches or pull requests

2 participants