Templates

Map

map.twig

The map.twig template displays an interactive map with photo markers based on GPS coordinates. It uses Leaflet.js and MarkerCluster by default, but you can use any map service (e.g. Google Maps, Mapbox, OpenLayers) by adapting the frontend implementation.

Available Twig Variables

The template receives a single variable: points - List of GPS-based image markers

This array contains all map points to be rendered. Each item represents a photo location and includes the following fields:

Variable Type Description
lat float Latitude coordinate
lng float Longitude coordinate
title string Title of the photo (shown in popup or tooltip)
image string URL to a small image preview (e.g. thumbnail used in the popup)

Example

Example Snippet for the Javascript

<script>
  const points = {{ points|json_encode|raw }};
</script>

The frontend script can use this points array with any map library of your choice to render markers and popups.

Previous
Timeline