CartoDB / carto-vl

CARTO VL: a Javascript library to create vector-based visualizations
BSD 3-Clause "New" or "Revised" License
129 stars 26 forks source link

Viewport numeric computation are somehow wrong when zoom is < 2 #1434

Open Captain-Oski opened 4 years ago

Captain-Oski commented 4 years ago

Hello,

We have a SQL source :

It takes a points table, summarize the sales by administrative areas, and feed the source as a polygon layer (geometries are joined from another polygon layer)

See the jsfiddle code for deeper understanding of the SQL statement

We have a VIZ :

     color: @colors
      strokeWidth: 0.1
      @r1: $r1
      @rtaidu: $fsa
      @total_spent: $total_spent
      @customerCount: viewportSum($count)
      @spentSum: viewportSum($total_spent)
      @orderSum: viewportSum($total_orders)
      strokeColor: rgba(0,0,0,0)
      @histogram: viewportFeatures($total_spent,$here_city,$fsa,$r1)
      @colors: ramp(linear($total_spent), peach)

When zoom to level 2 and lesser, viewport calculation are randomly divided

SEE GIF

70598d7795cbf4c64a9ec601f98609c4

See the jsfiddle here :

https://jsfiddle.net/captainOski/d87wx6zs/11/