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

(WIP) Add Bubbles layer type #1439

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

(WIP) Add Bubbles layer type #1439

wants to merge 1 commit into from

Conversation

yohanboniface
Copy link
Member

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) ?

image

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) ?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add another type of data layer : proportional circles
1 participant