Skip to main content

How do I add a geolocation map to the Custom PDF?

Learn how to add a map with the location recorded in your forms to DataScope's Custom PDF.

Written by Jessica Franco

You can add a geolocation map to your form's Custom PDF using the latitude and longitude coordinates recorded during the answer.

To set it up, you need to use an Image type component within the PDF Editor.

📍 Step 1: Open the PDF Editor

  1. Go to Forms.

  2. Select the form you want to configure.

  3. Go to Configure > Configure PDF > Custom PDF.

  4. Select Open PDF Editor.

📌 Step 2: Identify the latitude and longitude fields

Before adding the image, you need to identify the latitude and longitude fields corresponding to the question in your form that records the location.

To get them:

  1. In the PDF Editor, select Insert Data Field.

  2. Look for the question that contains the geolocation data.

  3. Select the fields corresponding to latitude and longitude.

  4. Write down or copy those field names, since you'll need them in the next step.

For example, for a question named "Client," the fields might look like this:

{k_Cliente_1::latitude} {k_Cliente_1::longitude}

📌 Important: these values are just an example. Field names depend on each form's structure.

🖼️ Step 3: Add an image and configure the map URL

Within the PDF Editor:

  1. Select an Image component.

  2. In the component's properties, find the Value field.

  3. In this field, add the map's URL, replacing the coordinates with the latitude and longitude fields you identified in the previous step.

For example, the full URL you need to enter in the Value field looks like this:

https://maps.googleapis.com/maps/api/staticmap?size=700x70&maptype=roadmap&markers=icon:https://www.mydatascope.com/assets/favicon.ico%7Csize:mid%7Clabel:1%7C{k_Cliente_1::latitude},%20{k_Cliente_1::longitude}&visible={k_Cliente_1::latitude},%20{k_Cliente_1::longitude}&zoom=15&key=AIzaSyB39JUuV_2N_2i-bh6tzAfPcEWxeUh777c

📌 Important: don't copy this URL directly. Replace {k_Cliente_1::latitude} and {k_Cliente_1::longitude} with the fields corresponding to your own form, obtained in the previous step.

🗺️ Step 4: Customize the map

The map's URL lets you configure different parameters, such as size, map type, and zoom level.

For example:

  • size=700x70 → Image size in pixels

  • maptype=roadmad → Displays the satellite view instead of the normal map.

  • markers=icon:URL_ICONO|size:mid|label:1|lat,long → Places a custom marker at the coordinates.

  • zoom=15 → Defines the map's zoom level.

Map types maptype:

Value

Description

Example

roadmap

Standard map with streets and roads (default mode).

satellite

Satellite imagery view without labels.🌍

hybrid

Satellite view with street labels and place names. 🏙️

terrain

Map with topographic information, elevations, and terrain. ⛰️

👀 Step 5: Check the preview

After configuring the URL:

  1. Select Preview.

  2. Check that the map appears correctly.

  3. Check that the marker matches the recorded location.

  4. If everything is correct, select Save.

From that point on, the map will appear in the Custom PDF generated for the form's answers.

⚠️ Doesn't the map appear?

If the map doesn't show correctly, check:

  • That the latitude and longitude fields correspond to your form.

  • That you used the fields from Insert Data Field.

  • That the answer has geolocation data recorded.

  • That the map's URL is set up correctly.

  • That you saved the changes in the PDF Editor.

💡 Important: if the answer doesn't contain geolocation data, it won't be possible to correctly show the map for that answer.

📌 Remember

The map uses the latitude and longitude coordinates recorded in each answer. That's why the location shown in the PDF depends on the geolocation data available for that answer.

👉 Want to customize your PDF even further? See: How do I customize the PDF generated in DataScope?
​

Did this answer your question?