Skip to content

Handle Attribute Names containing Dot Notation in Identify Templates #994

Description

@tchaddad

Stumbled on a case of a federal service that is returning features where the attribute names contain the parent table name using dot notation. This makes it difficult (currently impossible?) to set up an identify template in a map source because the expected format in the template is:

{{ properties.ATTRIBUTE }}

But the actual attribute names in the returned reqwest object are in this format:

"TableName.ATTRIBUTE"

Using <template name="identify" auto="true"/> will dump out all the available attributes as-is without a failure, but attempting to specify particular attributes in a custom identify template doesn't seem possible due to the dot notation.

This example map source to the live service should drop directly into the main GM demo:

	<map-source name="usfws-nwi" opacity="0.6" type="ags" >
		<url>
		https://fwsprimary.wim.usgs.gov/server/rest/services/Test/Wetlands_gdb_split/MapServer/export
		</url>
		<param name="cross-origin" value="anonymous"/>
			<layer name="Wetlands_CONUS_East" query-as="usfws-nwi-query/Wetlands_CONUS_East">
				<param name="layers" value="show:1"/> 
				<param name="FORMAT" value="image/png;bits=8"/>		
			</layer>
	</map-source>
	
	<map-source name="usfws-nwi-query" type="ags-vector">
		<url>
		https://fwsprimary.wim.usgs.gov/server/rest/services/Test/Wetlands_gdb_split/MapServer/1
		</url>
		<config name="pixel-tolerance" value="1"/>
		<param name="cross-origin" value="anonymous"/>
		<layer name="Wetlands_CONUS_East" title="NWI Wetlands">
				<template name="identify" auto="true"/>
				<!--  
				<template name="identify" ><![CDATA[
					<div > 
						<div  style="background-color: #7ABF6B; padding: 6px;"> 
							National Wetlands Inventory
						</div>
						<div style="padding: 2px;">	<b>Attribute: </b>{{ properties.Wetlands_CONUS_East.ATTRIBUTE}} </div>
					</div>  
					]]>				
				</template> 
				-->
		</layer>
	</map-source> 
	

Catalog snippet:
<layer title="National Wetland Inventory" src="usfws-nwi/Wetlands_CONUS_East" status="off" metadata="true" legend="false" fade="false" unfade="false">

Doing an identify on this layer should show the issue. The second template that is included but commented out would be an example of identifying just one field, which fails due to the field name format.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions