Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

Commit

Permalink
Change the zoom level reference used by world-discrete-ppi-scale
Browse files Browse the repository at this point in the history
`world-ppi-scale` and `world-discrete-ppi-scale` were using two
different zoom level reference values. This change ensures that
both operators use 17 as base zoom level reference for their
computations.

Signed-off-by: Roberto Raggi <roberto.raggi@here.com>
  • Loading branch information
robertoraggi authored and nzjony committed Sep 23, 2020
1 parent 862a06f commit e2371f4
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const operators = {
const pixels = context.evaluate(call.args[0]) as number;
const scaleFactor = call.args[1] ? (context.evaluate(call.args[1]) as number) : 1;
const zoom = context.env.lookup("$zoom") as number;
const zoomWidthDiscrete = Math.pow(2, 17.8) / Math.pow(2, Math.floor(zoom));
const zoomWidthDiscrete = Math.pow(2, 17) / Math.pow(2, Math.floor(zoom));
const v = pixels * zoomWidthDiscrete * scaleFactor;
return v;
}
Expand Down

0 comments on commit e2371f4

Please sign in to comment.