SMap_Canvas_Cache __construct(
SMap_Tile
$tile, array
$layers, integer
$fType
)
|
|
Create a cache object
The layers parameter
Parameters:
|
object The |
$tile: |
tile |
|
array |
$layers: |
Layers contained in this cache |
|
integer |
$fType: |
Image format |
Redefinition of:
- SMap_Canvas::__construct()
- Create a canvas which fits the current tile
Caches the image
Parameters:
API Tags:
boolean display(
integer
$fmt
)
|
|
Displays the image
If the image was cached, display it. Otherwise, take the passed image and cache it (then display it).
Parameters:
|
integer |
$fmt: |
Image format |
API Tags:
| Return: | Was the image sucessfuly cached and displayed? |
| Access: | public |
Redefinition of:
- SMap_Canvas::display()
- Display an image
void fileErr(
string
$fname
)
|
|
Checks a cache file for oddness
And throws an appropriate error
Parameters:
API Tags:
Creates the filename for a cached tile
We will need the identity of the map, which is passed in as a string. We will also need the identity of this tile, which we will be generating.
API Tags:
Was a cached image loaded?
API Tags:
mixed loadFromCache(
integer
$mtime
)
|
|
Loads a cached tile image
If a cached version of this tile exists, load it, but respect the cache time. If the file exists, but the age of the file is greater than the modification time, no image is loaded.
The expected filetype is one of the IMAGETYPE_* constants.
The last modified time is set as the modified time of the file using setLastModified(). The size of file read is limited to 4 MB. I can't think of a good reason for your tile to be larger than that anyway, so this may signal an error.
Parameters:
|
integer |
$mtime: |
Minimum file modification time. |
API Tags: