---
source: https://carbone.io/examples/dynamic-pins-on-map/
title: "Dynamic pins on a map | Carbone Sample"
description: "Merge JSON data with templates to generate documents in ODP/PPTX format. Easily map data dynamically for efficient and customizable document creation."
generated_at: "2026-07-13"
---

# Dynamic pins on a map

Generate a map with dynamic pins with Carbone

[![dynamic-pins-on-map thumbnail](/examples/dynamic-pins-on-map/thumb-result.webp)](/examples/dynamic-pins-on-map/result.pdf)

[Download Template](/examples/dynamic-pins-on-map/template.odp)

[Download data sample](/examples/dynamic-pins-on-map/data.json)

-   Template type document odp expert
-   Carbone min. v5.0.0+
-   Features transform set
-   Target maps markers longitude latitude

## Overview

Learn how to generate a presentation that includes:

-   Dynamic pin placement on a map
-   Conversion of geographic coordinates (latitude/longitude) into X/Y coordinates on an image

## Step-by-Step Guide

> ⚠️ **Warning:** This example uses a simplified calculation method for demonstration purposes.  
> The conversion of geographical coordinates is an approximation and does not follow strict cartographic principles.

Follow these steps to create an ODP template with dynamic map pins:

### 1\. Prepare the Map

Insert your map image into the template.

### 2\. Set Reference Points

Choose two fixed reference points on your map and record their:

-   GPS coordinates (latitude and longitude)
-   X and Y positions on the map (place a **shape** and note its position)

Example reference points:

```text
    Name    | PosX  | PosY  | Latitude  | Longitude
    Darwin  | 7.87  | 0.31  | -12.455   | 130.839
    Perth   | 1.58  | 8.77  | -31.953   | 115.863
```

Calculate the conversion coefficients:

```text
CoeffX = (7.87 - 1.58)/(130.839 - 115.863) = 0.420
CoeffY = (0.31 - 8.77)/(-12.455 - (-31.953)) = 0.4334 
```

### 3\. Configure Dynamic Pin Position

-   Place a single **shape** on the map that will serve as the movable pin
-   Right-click the shape and access the **Alt text** menu
-   Add the following formulas to convert coordinates using the [:transform](/documentation/design/advanced-features/transform.md) formatter:

```text
{d.location[i].longitude:sub(115.863):mul(0.420):sub(7.87):add(1.58):transform(x,cm)}
{d.location[i].latitude:sub(-31.953):mul(-0.4334):add(8.77):transform(y,cm)}
```

> ⚠️ **Warning:** Use a **shape** element (not an image) to ensure the transform formatter works correctly.

### 4\. Add Title and Image Placeholder

To finalize the template and illustrate the pin position with corresponding title and image:

-   Insert a temporary image
-   Right-click and open the **Alt text** menu
-   Specify the image path using: `{d.location[i].image}`
-   Insert a textbox and write the [Carbone tag](/documentation/design/substitutions/the-basics.md#basic) `{d.location[i].name}`
-   Choose a clear and attractive font.

That's it! Your template will now display dynamic pins based on geographic coordinates, each accompanied by a clear image.

## Related Examples

[![financial-report thumbnail example](/examples/financial-report/thumb-result.webp)](/examples/financial-report/index.md)

## Trusted by 800+ paid customers in 40+ countries

## Related topics

- [Transport ticket](/examples/ticket/index.md)
- [Summary](/examples/summary/index.md)
- [Stock inventory spreadsheet](/examples/stock-inventory-spreadsheet/index.md)
- [Store Inventory](/examples/shoes/index.md)
- [Sensor readings](/examples/sensor-readings/index.md)
- [Real estate property document](/examples/real-estate-property-description/index.md)
