Manage template
Templates are used to change map designs by applying them to containers.
getAllTemplates
Fetch all templates availables for current map
Parameters
No parameter
Result
Name | type | description |
---|---|---|
templates | Template[] | All available templates |
Example
FnoMapManager.sendEvent('getAllTemplates', null, (data) => {
console.log("templates:", data.templates);
});
setLocalTemplate
Apply a template to a container
Parameters
Name | type | description |
---|---|---|
container | number | container id to apply template |
template | number | template id to used |
Result
No result
Example
FnoMapManager.sendEvent('setLocalTemplate', {container: 123, template: 1});
clearLocalTemplate
Remove a template from a container
Parameters
Name | type | description |
---|---|---|
container | number | container id |
template | number | (optionnal) if set, remove only this template, if null, remove all templates |
Result
No result
Example
FnoMapManager.sendEvent('clearLocalTemplate', {container: 123, template: 321});
clearAllLocalTemplates
Remove all templates or one template for all containers
Parameters
Name | type | description |
---|---|---|
template | number | (optionnal) if set, remove only this template for all containers, if null, remove all templates for all containers |
Result
No result
Example
FnoMapManager.sendEvent('clearAllLocalTemplates', {template: 321});