How-to add Identify
Identify is supported on wms
, mapserver
, wfs
, mapserver-wfs
, and ags-vector
map-source types.
TL;DR Add a <template name="identify">
to the <layer ...>
which needs identify.
The Firestations layer
This how-to references the firestations
source and fire_stations
layer.
For more information on setting those up in your local demo, read the
How-to add a layer guide.
Adding identify to Firestations
- WMS has the GetFeatureInfo request which GeoMoose will use to fetch feature data.
- GeoMoose will also use WFS and AGS FeatureServer for identify if a
<map-source>
is configured withwfs
,mapserver-wfs
, orags-vector
. - For a layer to work with identify it needs to have a
<template>
namedidentify
- In the
mapbook.xml
file update thefirestations
<map-source>
definition:
<map-source name="firestations" type="mapserver">
<file>./demo/firestations/firestations.map</file>
<layer name="fire_stations">
<template name="identify"><![CDATA[
<div class="result-item">
<div class="result-title">
Firestation
</div>
<b>Station City:</b> {{ properties.Dak_GIS__4 }}<br>
<b>Station Number:</b> {{ properties.Dak_GIS__5 }}<br>
</div>
]]></template>
</layer>
</map-source>
- This example uses GeoMoose’s template system. GeoMoose has a rich template system provided by Mark.up. More information on GeoMoose templates here.