SMap_Layer __construct(
SMap
$map,
$id
)
|
|
Construct the layer
Each layer should have a unique ID
Parameters:
|
integer |
$map: |
This layer's ID |
|
|
$id: |
|
Redefined in descendants as:
How cachable is this layer?
Return the "cache status" of this layer. The intent of this is to determine whether we should use the cache images generated by this layer.
False is returned if the layer should not be cached. True is returned if the layer can be cached, but it really doesn't matter either way. For real control when caching, return an integer. The returned number should be the number of seconds the cache is valid for.
Note that SMap_Tile::tileGrid is ignored when caching.
API Tags:
array getAdjViewBounds(
array
$tG
)
|
|
Adjust the view coords if we are in an image
Uses the current bounds and the tile grid to calculate the view bounds of the original image.
Parameters:
|
array |
$tG: |
The current tile grid |
API Tags:
| Return: | The overall view bounds |
| Access: | protected |
Returns the ID of this layer
No two layers should have the same ID
API Tags:
| Return: | This layer's ID |
| Access: | public |
Recommended format for this layer
What is the best image format for this layer? The IMAGETYPE_PNG should be used for line art and text. IMAGETYPE_JPEG should be used for photographs, such as satelite imagery.
A PNG image is a
"lossless" image. All information is kept. This is the default, but for the best file size, use JPEG on photographic images.
To be safe, this value is not determined within the SMap package, so if you wish your layer to express its preference, you will have to override this method.
API Tags:
Composite this layer onto the tile (in a raster way)
Parameters:
|
object The |
$view: |
view we are compositing in |
|
object The |
$tile: |
tile we are compositing to |
API Tags:
| Return: | The objects to composite |
| Access: | public |
| Abstract: | |
Redefined in descendants as:
Return the map that contains this layer
API Tags:
| Return: | map object |
| Access: | public |
Composite this layer onto the tile
Parameters:
|
object The |
$view: |
view we are compositing in |
|
object The |
$tile: |
tile we are compositing to |
API Tags:
Redefined in descendants as:
boolean hasCachedRects(
)
|
|
Might have cached rects in the DB
Might this layer have cached rects in the DB? Layers which have cached rects include layers which use labels.
API Tags:
Redefined in descendants as:
boolean isValidZoom(
$zoomNum
)
|
|
Is this layer zoomed to a useful resolution?
Note that a layer should be drawable at any resolution, but sometimes it just doesn't make sense to zoom in anymore. This may be because an image is at it's maximum resolution, or all the labels are displayed easily, or only a few regions are displayed.
Parameters:
void pxOffBound(
SMap_View
$view, integer
$boundSide, integer
$pixels
)
|
|
Get the bound at a pixel offset from a bound.
Parameters:
|
object View |
$view: |
we are drawing in |
|
integer |
$boundSide: |
Index of the side we are working with |
|
integer |
$pixels: |
Pixels offset |
API Tags: