Getfeatureinfo Template Mapserver

Getfeatureinfo Template Mapserver

Introduction GetFeatureInfo is a WMS standard call that allows one to retrieve information about features and coverages displayed in a map. The map can be composed of various layers, and GetFeatureInfo can be instructed to return multiple feature descriptions, which may be of different types. Tinymce Wysiwyg Editor Joomla Social Club Game. here.

GetFeatureInfo can generate output in various formats: GML2, plain text and HTML. Templating is concerned with the HTML one. The default HTML output is a sequence of titled tables, each one for a different layer. Card Game Stargate Trading on this page. The following example shows the default output for the tiger-ny basemap (included in the above cited releases, and onwards).

Documentation

Below is an example of a GetFeatureInfo request with the xslt_template parameter: http://gisserver.domain.com/arcgis/services/ihs_petroleum/MapServer/WMSServer. Use OpenLayers WMSGetFeatureInfo on Mapserver. I want my mapfile to support the GetFeatureInfo-request for some layers. I added the following line to the layer: TEMPLATE 'change-template.txt' And the fileitself.

Standard Templates The following assumes you’re already up to speed with Freemarker templates. If you’re not, read the tutorial, and the page, which has simple examples. The default output is generated by the standard templates, which are three: • header.ftl • content.ftl • footer.ftl The header template is invoked just once, and usually contains the start of the HTML page, along with some CSS. The default header template looks like this (as you can see, it’s completely static, and it’s in fact not provided with any variable you could expand). Custom Templates So, what do you have to do if you want to override the custom templates?

Well, it depends on which template you want to override. Header.ftl and footer.ftl are type independent, so if you want to override them you have to place a file named header.ftl or footer.ftl in the templates directory, located in your GeoServer. On the contrary, content.ftl may be generic, or specific to a feature type. For example, let’s say you would prefer a bulleted list appearance for your feature info output, and you want this to be applied to all GetFeatureInfo HTML output. In that case you would drop the following content.ftl in the templates directory. Bulleted List Output Looking at the output we notice that point of interest features refer to image files, which we know are stored inside the default GeoServer distribution in the demo_app/pics path.

So, we could provide a POI specific override that actually loads the images. This is easy: just put the following template in the feature type folder, which in this case is workspaces/topp/DS_poi/poi (you should refer to your Internet visible server address instead of localhost, or its IP if you have fixed IPs).

Reporter: dmorissette Date: 2010/09/24 - 20:11 Trac URL: Every once in a while we get requests for a simple way to test a mapfile. One way to handle this could be to do as GeoServer does and provide a built-in OpenLayers based map viewer. In the GeoServer case, this viewer is returned when one issues a WMS GetMap request with format=application/openlayers in it. I propose that we provide a similar functionality in MapServer, which would be triggered in one of two ways: 1- Using mapserv?map=/path/to/my.map&''mode=openlayers''. In this case the viewer would be initialized based on the mapfile defaults, and some of the traditional mapserv CGI params may also work (such as map size, layer selection, etc.) 2- Using ''format=application/openlayers'' in a WMS GetMap request as GeoServer does.

Note that in this case the rest of the GetMap parameters would be used to configure the map to view (BBOX, WIDTH, HEIGHT, LAYERS, etc.) Both cases would call the same function internally to produce a simple OpenLayers viewer with one singletile layer for the whole map with the selected layers. Author: dmorissette Date: 2010/09/28 - 20:25 An important comment that was made on the -dev list while discussing this was that relying on may cause problems if/when the version of OpenLayers.js changes in the future. Two options were proposed: 1- Point to a specific version of OpenLayers.js, e.g. 2- Host our own stripped down version of OpenLayers.js on, with just the stuff we need for WMS and a couple of basic controls.

In this case the URL that we use should still take versioning into account.