[Question] How to load and use country-level GeoJSON maps in ECharts?
Hi team 👋
I'm building an ECharts-based map interface in a React app and looking for guidance on how to:
- Get the appropriate GeoJSON files (e.g., for countries like India or the USA). Is there a way we can fetch GeoJSON files dynamically, from a source that provides it for all countries?
- Dynamically load these into the chart
- Add
mappointseries for city markers (based on lat/lon) - Optionally implement clustering based on zoom
I came across the echarts-countries-js package, which seems useful — but I wasn't sure if that's the recommended approach or if there's an official source for GeoJSON files.
Are there any example implementations (e.g., on CodeSandbox/CodePen) that I could look at?
Thanks a lot in advance for any help 🙏
Summary:
- Where to find the official or recommended GeoJSON files for different countries?
- How to load these GeoJSON files dynamically (e.g., on zoom or click)?
- Are there any examples (like on CodeSandbox or CodePen) that show:
- Loading GeoJSON dynamically
- Adding map points
- Possibly clustering markers based on zoom
Asking "how to" or "usage" questions or requesting detailed debugging help is discouraged by the official posting guidelines:
The issue list is reserved exclusively for bug reports and feature requests. For usage questions, please use the following resources:
- Read the docs
- Find in examples
- Look for / ask questions on Stack Overflow
Marker clustering is a feature that has been mentioned before in #19554. In certain cases it could be substituted with heatmap
Asking "how to" or "usage" questions or requesting detailed debugging help is discouraged by the official posting guidelines:
The issue list is reserved exclusively for bug reports and feature requests. For usage questions, please use the following resources:
- Read the docs
- Find in examples
- Look for / ask questions on Stack Overflow
Marker clustering is a feature that has been mentioned before in #19554. In certain cases it could be substituted with heatmap
Can we seek help from developers to support the map aggregation function? Thank you very much