mirror of
https://github.com/klokantech/tileserver-php.git
synced 2025-08-05 14:18:13 +02:00
Custom templates
@@ -1 +1,9 @@
|
||||
Welcome to the tileserver-php wiki!
|
||||
## Custom templates
|
||||
TileServer in default uses Klokantech's TileViewer. TileViewer is constructed as viewer/example base. You can find there pre-generated viewers from most used JavaScript libraries such as google Maps API, OpenLayers or Leaflet. In TileViewer is also tutorials, embed links, links to GIS web services provided by TileServer and more.
|
||||
|
||||
In TileServer is possible to define a custom template which will be served on a root instead of TileViewer. The template is meant as single HTML or PHP file which will be included into a script. To define a template and turn on this functionality is necessary to uncomment variable on [line 13](https://github.com/klokantech/tileserver-php/blob/master/tileserver.php#L13) in a tileserver.php file and set a right string name of template e.g. `$config['template'] = 'template.php'`. If you are running it in docker you can set template variables as environment variable.
|
||||
|
||||
In this file could be used variables from PHP with information about layers. TileServer puts those variables into PHP template. Flowing variables are provided:
|
||||
`$baseUrls` - array with URLs to server
|
||||
`$serverTitle` - string with name of server from config
|
||||
`$maps` - array with metadata about each layer
|
Reference in New Issue
Block a user