-
-
Notifications
You must be signed in to change notification settings - Fork 213
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
Add another type of data layer : proportional circles #1399
Comments
Here is an example with Overpass Turbo : bicycle parkings where the surface is proportional to their capacity Another example with the population of cities, where a factor is required to let the circles have a sensible size : http://overpass-turbo.eu/s/1DSp. Note the sqrt() which is needed for most (all ?) types of values, so that the surface of the circle (rather than the diameter) is proportional to the value. |
fix #1399 This is a very first look. But it's not as simple as I thought, because: - as for a heatmap, we need a special representation (each feature should be a circle, not a normal icon nor a polygon) - as for a choropleth, we want to dynamically take control over the rendering (we need all the features to be able to compute the bubbles sizes) - as for a normal layer, we want all the features to react to interaction, specifically click to open a popup, but also tooltip, highlight (?), etc. In this first implementation, I've created a new type of layer, that creates a CircleMarker for each feature, but doing so we lose all the interactions. I've tried to set a sort of proxy so that a click on the circle will fire a click on the feature, but as this feature is actually not on the map, this does not work naturally. Also, at this point, the styling is only done once, so editing layer's style will not be updated live in the map. A few more thinking is needed, mainly to decide how to handle the circle: should it be a "proxy layer" as now, or should we try to transform a feature on the fly (make sure it is a marker of type circle, but as for now our circle are html, not svg…), and in this case, should we magically handle polygons and polylines (taking their center), or only markers (which could be easier, and possibly enough) ?
Is your feature request related to a problem? Please describe.
The addition of cloropleth data layers triggers another idea : showing point data as proportional circles, i.e. circles whose area is proportional to the value of a numerical field.
Describe the solution you'd like
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
![image](https://private-user-images.githubusercontent.com/6516063/281786466-e39e70a1-7805-4528-9b38-317455ec1148.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk2MjU1NDMsIm5iZiI6MTcxOTYyNTI0MywicGF0aCI6Ii82NTE2MDYzLzI4MTc4NjQ2Ni1lMzllNzBhMS03ODA1LTQ1MjgtOWIzOC0zMTc0NTVlYzExNDgucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDYyOSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA2MjlUMDE0MDQzWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9OTJjNzc4ZDdiNmNmNGIxMmQ5NDJiZTI4ZGQ3MjgzNDk3MTJjNzI1NDAzMzliNDJlMzU3M2E5NjU2YTkwYTk2ZCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.-mujoBX2NouKxGrztKSVpyG-owPiAcFiaEHDSEdRi78)
Example map :
The text was updated successfully, but these errors were encountered: