1

In some d3 tile map example, when use projection to set zoom scale , it always times 2*Math.PI.

for example, in this demo "D3 Tile Map with Hand-Drawn Polygon".

http://bl.ocks.org/emeeks/11051379

var zoom = d3.behavior.zoom()
.scale(projection.scale() * 2 * Math.PI)
.translate([width - center[0], height - center[1]])
.on("zoom", redraw);

I think the projection.scale() is pixel unit. very confuse what unit zoom scale() use.

max
  • 146
  • 1
  • 8
  • 2
    I didn't get the whole thing either. But one thing this reminds me that it has something to do with 2πr which is the perimeter of a circle. It is calculating the perimeter of the visible area by taking the scale size as radious. It's a long range shot but that's all I can imagine. – Litestone Nov 21 '14 at 01:58
  • 1
    @Litestone, I agreed. zoom scale is radious of the ball.Thank you so much. You solve my problem. hope someone can help accept your comment as answer.:) – max Nov 22 '14 at 15:41

0 Answers0