static array centerBounds(
float
$Bx, float
$By, float
$muPerTileX, float
$muPerTileY, integer
$tilesX, integer
$tilesY, [boolean
$normalize = true]
)
|
|
Create bounds centered on this point
Parameters:
|
float |
$Bx: |
Center point X |
|
float |
$By: |
Center point Y |
|
float |
$muPerTileX: |
Map units per tile X |
|
float |
$muPerTileY: |
Map units per tile Y |
|
integer |
$tilesX: |
Number of tiles that should be in the X dir |
|
integer |
$tilesY: |
Number of tiles that should be in the Y dir |
|
boolean |
$normalize: |
Normalizes bounds also (default= true) |
API Tags:
static integer dec(
string
$chr
)
|
|
Decode a char as an integer
Unpack the url.
Parameters:
API Tags:
static string enc(
integer
$int
)
|
|
Encode an integer as a char
This function is used so we can pack the URL smaller. The chars used are [0-9A-Za-z].
Parameters:
API Tags:
static string genMapKey(
array
$layers, integer
$zoom, string
$lang
)
|
|
Generates a map key that can be used to identify a layout that may be stored in the database or filesystem.
The layers list must be a numrical list in the order that the layers were applied.
Parameters:
|
array |
$layers: |
Active layers. |
|
integer |
$zoom: |
Current view level. |
|
string |
$lang: |
ISO 639-2 three letter language string |
API Tags:
static string genTileKey(
array
$bounds, array
$tileGrid
)
|
|
Generate a key for a tile
The layers list must be a numrical list in the order that the layers were applied. Uses reduceSigFigs() to round the floats, so you can use 'sigFigs' to alter the size of thte numbers produced.
Parameters:
|
array |
$bounds: |
Bounds array |
|
array |
$tileGrid: |
Position relative to other tiles |
API Tags:
static void normalizeBounds(
array
&$B, float
$muPerTileX, float
$muPerTileY, integer
$tilesX, integer
$tilesY
)
|
|
Shifts the given bounds to be "normal"
Shifts the bounds to contain an integer multiple of tiles, and for there to be an integer multiple of tiles between the current bounds and (0,0). When tiles are normalized like this there can be less precision in the URL. Any rounding errors are normalized out here.
Parameters:
|
array |
&$B: |
Bounds to normalize |
|
float |
$muPerTileX: |
Map units per tile X |
|
float |
$muPerTileY: |
Map units per tile Y |
|
integer |
$tilesX: |
Number of tiles that should be in the X dir |
|
integer |
$tilesY: |
Number of tiles that should be in the Y dir |
API Tags:
static string reduceSigFigs(
float
$float
)
|
|
Rounds to reduce the number of sig figs in a float
Useful when comparing two floating point numbers and printing numbers on a page. It should print numbers such that similar floating point numbers are always printed with the same string.
Use the 'sigFigs' option to alter the precision of the produced strings.
Parameters:
|
float |
$float: |
Just another float. |
API Tags:
static string transPng(
string
$url, string
$alt, integer
$w, integer
$h, string
$tags, string
$style
)
|
|
Make an XHTML image tag compatable with IE
MSIE sucks at the whole "internet" thing. Maybe they'll get it right next time. In the mean time, this function specifically emits an image tag that hacks transparency into a given PNG.
Parameters:
|
string |
$url: |
Image URL |
|
string |
$alt: |
Image Alt tag |
|
integer |
$w: |
Image width |
|
integer |
$h: |
Image height |
|
string |
$tags: |
Extra tags (caller escapes) |
|
string |
$style: |
Extra style (caller escapes) |
API Tags:
| Return: | Image tag |
| Access: | public |
static void wrapBounds(
array
&$bounds, array
$wrap
)
|
|
Shifts a view around a wrapped map
Parameters:
|
array |
&$bounds: |
The bounds to wrap |
|
array |
$wrap: |
The wrapping information |
API Tags: