Skip to main content
Skip table of contents

Display Pattern: Geo Point

Summary

Show a Google Maps link to the company headquarter, using the geolocation values, joined with a comma.

JSON
{% if data.corporateInformation.headquarterLocation %}
  {% assign HqLocationLat = data.corporateInformation.headquarterLocation.lat %}
  {% assign HqLocationLon =data.corporateInformation.headquarterLocation.lon %}
  {% assign HqLocation = HqLocationLat + "," + HqLocationLon %}
  <a href="http://www.google.com/maps/place/" + HqLocation> Headquarter </a>
{% endif %} 

Setup in Picturepark

  • Layer: Corporate Information

  • Field: Headquarter Location

Field Value Access

data.corporateInformation.headquarterLocation.lon
data.corporateInformation.headquarterLocation.lat

  • You cannot just access the Geo Point as a combined value. You must construct the point yourself in the Display Pattern, so check if the field has a value and then show latitude and longitude separated by a comma. 

Use Case

Check if the Geo Point field has values, then assign the Latitude to a variable and Longitude to a variable. Then join the two variables with a comma and create a link using the constructed variable and a fixed link text.

JSON
{% if data.corporateInformation.headquarterLocation %}
  {% assign HqLocationLat = data.corporateInformation.headquarterLocation.lat %}
  {% assign HqLocationLon =data.corporateInformation.headquarterLocation.lon %}
  {% assign HqLocation = HqLocationLat + "," + HqLocationLon %}
  <a href="http://www.google.com/maps/place/" + HqLocation> Headquarter </a>
{% endif %} 



JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.