Skip to main content

Add a CARTO layer to Fulcrum

Learn how to create and add map layers in Fulcrum from CARTO

Adrian Zuniga avatar
Written by Adrian Zuniga
Updated yesterday

Overview: Using CARTO Named Maps

CARTO supports direct tile access via Named Maps, which is the required method for loading CARTO layers into Fulcrum. Since this process may require manual configuration using the CARTO Named Maps API, the following steps detail the necessary setup and the URL scheme needed to integrate the layer into Fulcrum.

Prerequisites

To successfully complete this process, you will need the following information from your CARTO account:

  • Your CARTO username.

  • Your CARTO API Key.

  • The name of the named map layer you create (e.g., tax_parcels).


Steps to Add the Layer to Fulcrum

Once your named map has been created and published in CARTO (which may involve using the Named Maps API to POST your JSON template), you can integrate it into Fulcrum using the following URL structure:

1. Create and Publish the Named Map (Technical Setup)

This step requires using the command line or terminal to interact with the CARTO Named Maps API.

A. Create the JSON Template

Create a file named template.json containing the definition for your map layer. Replace tax_parcels with your layer's name and update the sql and cartocss as needed:

JSON

{
"version": "0.0.1",
"name": "tax_parcels",
"layergroup": {
"layers": [{
"type": "cartodb",
"options": {
"cartocss_version": "2.1.1",
"cartocss": "#tax_parcels{polygon-opacity: 0;line-color: #D6301D;line-width: 1.5;line-opacity: 1;}",
"sql": "SELECT * FROM tax_parcels"
}
}]
}
}

B. POST the Template via Command Line

Use the following curl command in your terminal to POST the template and create the named map. Replace the bracketed placeholders ({...}) with your specific CARTO username and API key:

Bash

curl -X POST \
-H 'Content-Type: application/json' \
-d @template.json \
'https://{username}.carto.com/api/v1/map/named/?api_key={api_key}'

2. Construct the Tile URL

Once the named map is created, you can construct the map layer URL using the following scheme. Replace the bracketed placeholders ({...}) with your specific CARTO details:

https://{username}.carto.com/api/v1/map/named/{layer_name}/all/{z}/{x}/{y}.png

  • Replace {username} with your CARTO account username.

  • Replace it {layer_name} with the exact name you gave your named map in the JSON template (e.g., tax_parcels).

  • Example URL: https://mycompany.carto.com/api/v1/map/named/tax_parcels/all/{z}/{x}/{y}.png


3. Add the Layer to Fulcrum

  1. Navigate to the Settings menu in the Fulcrum web app.

  2. Go to the Map Layers section.

  3. Click Add Layer and select the appropriate layer type (usually XYZ Tiles for CARTO).

  4. Paste the completed Tile URL (from Step 2) into the URL field.

  5. Provide a clear name for the layer (e.g., "CARTO Tax Parcels").

  6. Configure any other settings, such as Attribution, and click Save.

You can read more about Named Maps in CARTO here. For more information on adding map layers from other popular web services, please visit our guide on Adding Map Layers From Web Mapping Services.

Did this answer your question?