I'm trying to create a map that would have marker clusters based on geographic restrictions. For example a cluster for the country that would contain all the marker clusters of the regions of the country, the regions would contain provinces, provinces municipalities and so on.
This website is a good example of what I'm trying to achieve: https://laruchequiditoui.fr/fr/assemblies#5/46.655/2.659
The data I have is stored in JSON, divided by Levels,
Level_0 (highest - country) :{
level_1 (regions),
level_2 (districts), ...
level_n(lowest- towns/municipalities, etc.)
}
Each item in the level has a property of the administrative division above it, that it belongs to, so I wouldn't need to cluster them based on borders eg. geojson, I just need to associate the items to group into a certain cluster based on that value and not based on distance.
I was thinking about creating a cluster for each individual region, province, etc. but I don't think that's a good way of doing as some countries have thousands of divisions + I'm not sure how I'd even create them dynamically for every country and division.
The other thing that I'm trying to do is to have the marker clusters display the flags of the current region. For example top marker cluster fof the country would have an icon for the flag of the country, when zoomed in the regions would have an icon with the flag of the region, etc. etc.
I'd really appreciate some pointers on how to get started with this, I haven't had much luck finding anything online except a deleted Github thread about this exact issue and I've been stuck on it for weeks.