CartoDB / toolkit

JS library to interact with CARTO APIs in a simple way
https://toolkit-wheat.now.sh
BSD 3-Clause "New" or "Revised" License
9 stars 3 forks source link

Dynamic raidus scale for points size based on pixels #86

Closed manmorjim closed 4 years ago

manmorjim commented 4 years ago

The radius size for points is based on distances (meters/degrees) rather than pixels so they are adapted depending on the zoom level:

Peek 2020-04-28 16-46

It is desirable to have radius size based on pixels since this is the most common form of representation for points. By this way, they are still visible in low zoom levels by keeping their size.

For lines there is a property called lineWidthUnits which accepts the value 'pixels'.

Unfortunately this options is not available for points so a workaround would be using dynamic radiusScale like is described in https://github.com/visgl/deck.gl/issues/1259#issuecomment-352938186

Something like setting radiusScale as pixel per meters multiplying factor that you can get from the viewport. This has to be updated everytime the zoom changes: https://github.com/visgl/deck.gl/blob/master/modules/core/src/viewports/viewport.js#L92

VictorVelarde commented 4 years ago

@manmorjim I think we should try to move this discussion to clubhouse (perhaps creating a new story linked to SizeBinsStyle helper one... just copy this 🔝 content as it is), leaving GH just for the linked PRs.

If you do that, please share the story number with me and then we can close this issue

manmorjim commented 4 years ago

done! moved to 72601

VictorVelarde commented 4 years ago

Thx