Default Templates
Default templates are used by the Local Knowledge service if a specific template for a layer is not defined.
Default templates should be created for both AMP and FMN query types, in total 5 templates will need to be defined:
- AMP and FMN Summary Template
- FMN Full Template
- AMP and FMN Nothing Found Template
These templates should be added to the Templates table of the webMapLayersConfig.db.
Default AMP Summary Template
Example html:
<div>Found Stuff on {Name}<p></div>
This will result in a line of text in the results dialog which states “found stuff on” followed by the overlay name that the query was run on.
Default FMN Summary Template
Example html:
<div class="FMNSummaryContainer"><i><b><div class="FMNOverlayName">{Name}</div></b></i><div class="FMNItemContainer"><repeater {Items} ><div class="FMNItem"><a href="javascript:zoomToFMNItem({OverlayNo}, '{escape(Name)}')" >{Name}</a></div></repeater></div><p></div>
This will result in the overlay name being displayed, followed by a simple list of the found items
Default AMP and FMN Nothing Found Template
The same Nothing Found Template can be used for the AMP and FMN templates.
Example html:
<div><i><b>There were no results found for<div class="FMNOverlayName">{Name}</div></b></i><div></br>
This will result in the text “There were no results found for” followed by the overlay name:
Setting the Default Templates for the Service
To set the templates you have to make edits to some tables in the webMapLayersConfig.db, you need to:
- Add html code to the Templates table
- Note TemplateID
- Use the TemplateID to define the appropriate template in the ServiceTemplates table
- Define appropriate templates using their TemplateID
Templates Table
ServiceTemplates Table
Web Map Layers 8.0 will then use the templates defined above if no specific layer templates are defined.
Defining Specific Layer Templates
Layer specific templates are defined in a similar way to the default templates but instead of entering the TemplateID into the ServiceTemplates table, it is added to the Layer Templates table:
- Add html code to the Templates table
- Note TemplateID
- Use the Template ID to define the appropriate template in the LayerTemplates table
The following sections of the help work through all the available local knowledge query types, within these sections you will find examples of the html code used to create the templates for the installed version of Web Map Layers 8.0.
Once the template has been defined, the ID will be generated and it can then be referenced in the LayerTemplates table:
![]() |
The string in the Name column must EXACTLY MATCH the name of the overlay in the LocalKnowledge.swd |
If no ID is referenced here, the service will use the default template in the ServiceTemplates table.
Send comments on this topic.