-
Notifications
You must be signed in to change notification settings - Fork 95
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
Bug when loading the Map with specific geojson #1493
Comments
Do you mean that exactly same GeoJSON sometimes produces proper map and sometimes this square? Would you be able to post this as a runnable demo, e.g. on CodePen? |
Yes, Exactly. I'm going to do this CodePen in the next week and put the link here. |
So, I created a example in the following repository : It's a simple nextjs project with only 1 page, the dashboard page. So, to test the app you need only enter in localhost:3000/dashboard To install the package is necessary npm install and after to run npm run dev. If the necessary I can deploy the project also to the vercel. It was possible to reproduce the bug when I change the select state, as is possible to see in following picture: The geojson is in the maps_counties folder |
Can you post just the GeoJSON? I don't have a GitLab account and they are making me jump through all these hoops just to access a repo. |
Here a json used in the example |
If you want I can put in the github also. |
The first load is fine, the problem is when I change the map based in a react state condition. The information is charged in the map but the image break |
Here the link to github repo: https://github.com/luanrjjj/map-test/tree/main/amcharts-map-test-debug-main/my-app |
You need enter in /dashboard path. http://localhost:3000/dashboard |
I think I know what's going on. When you use If you set The solution would be to always create a shallow copy of the GeoJSON you set:
|
I did some testes here. It's better, but still unstable: the reload is broken with a probability around 30% - 50%. Do you have some other tip? |
I can't seem to be able to reproduce this outside of your specific app. Here's a very basic repro case using your GeoJSON: Technically, shallow-copying GeoJSON should be enough, as per above demo. |
This issue is stale because it has been open 30 days with no activity. It will be closed in 5 days unless a new comment is added. |
When attempting to load a map using a specific GeoJSON file representing the states of Brazil, I encounter a situation where sometimes I face the following issue:
I have researched this problem, and typically, the issues reported here or on StackOverflow are related to the direction of GeoJSON coordinates. However, in my case, the loading process occurs normally. Despite this, even after a successful reload, a state may still break during subsequent reload attempts. I am using React with amCharts 5.
The text was updated successfully, but these errors were encountered: