Class: Grid
Grid(center, size)
new Grid(center, size)
The constructor.
Parameters:
Name | Type | Description |
---|---|---|
center |
Vertex | The offset of the grid (default is [0,0]). |
size |
Vertex | The x- and y-size of the grid. |
Members
(static) utils
Methods
(inner) baseLog(base, num) → {number}
Calculate the logarithm of the given number (num) to a given base.
This function returns the number l with
This function returns the number l with
num == Math.pow(base,l)
Parameters:
Name | Type | Description |
---|---|---|
base |
number | The base to calculate the logarithm to. |
num |
number | The number to calculate the logarithm for. |
Returns:
log(base)/log(num)
- Type
- number
(inner) mapRasterScale(adjustFactor, scale) → {number}
Calculate the raster scale for a given logarithmic mapping.
Example (with adjustFactor=2):
Example (with adjustFactor=2):
If scale is 4.33, then the mapping is 1/2 (because 2^2 <= 4.33 <= 2^3)
If scale is 0.33, then the mapping is 2 because (2^(1/2) >= 0.33 >= 2^(1/4)
Parameters:
Name | Type | Description |
---|---|---|
adjustFactor |
number | The base for the logarithmic raster scaling when zoomed. |
scale |
number | The currently used scale factor. |
Returns:
- Type
- number