Bootstrap, CSS, CSS3, Data Structure, Development, GeoServer, HTML, HTML5, JavaScript, jQuery, PHP

GeoServer – GetFeatureInfo Template Data Model (structure)

Extend from this GeoServer – Custom Get Feature Info Display

Knowledge requirement – Freemaker

The standard template files is header.tpl, content.tpl, footer.tpl.

header.tpl usually where JavaScript, CSS, meta tag, title placed here.

footer.tpl where you put your HTML page footer, Copyright, etc.

content.tpl where we going to iterate through all the features to display interactive UI. But here, I’m going to explain the structure of all available variables.

features (array of Feature)
		- fid
		- typeName
		- attributes
			-> name
			-> type
			-> isGeometry
			-> value
		- type
			-> name
			-> title
			-> abstract
			-> description
			-> keywords
			-> metadataLinks
			-> SRS
			-> nativeCRS
type (object of Feature Map)
	- name
	- attributes
		-> name
		-> type
		-> isGeometry

Accessing the variables as following:

<!-- Accessing Feature Type Name -->

<!-- Accessing Features at index 0 and assign to a variable named feature -->
<#assign feature = features[0]>

<!-- Get feature's attributes values and assign to a variable named attrs -->
<#assign attrs = feature.attributes>

<!-- Display an attribute -->

The result may display as below:

This is type name

some field name value


Leave a Reply

Your email address will not be published. Required fields are marked *

4 − two =