Spatial Analysis in 2025: Key Trends Report
| Download Now
CARTO
Platform
Overview
Visualization
Analytics
App Development
Data Enrichment
AI Agents
Enterprise & Security
Pricing
CARTO for
Google Cloud
AWS
Azure
Snowflake
Databricks
Oracle
Solutions
By Industry
By Use Case
By Role
Telecoms
Icon/indus/Insurance-menu
Icon/indus/Insurance-menu-mobile
Insurance
Logistics
Real Estate
Financial Services
Retail
Marketing & Advertising
Mobility
All industries
Network Deployment
Catastrophe Modeling
Fraud Detection
Market Analysis
Environmental Management
Site Selection
Geomarketing
Data Monetization
IoT Analytics
Supply Chain Optimization
Healthcare Analytics
Territory Planning
All use cases
Data Analyst
Data Scientist
GIS Professional
Developer
Customers
Resources
Learn
Documentation
CARTO Academy
Blog
Reports
Glossary
Connect
Events
Partners
Webinars
Log inRequest a demo
Try for free
2050-01-01
1990-01-01
"ES", "GB"

This content applies to a previous version of CARTO

In October 2021 we released a new version of our platform. You can find the latest documentation at docs.carto.com

Back to Help Center

How can I create a storytelling map with CARTO.js?

Overview

A storytelling map combines CARTO.js with Storymap.js to create an interactive narrative experience. You can advance through the story by scrolling down the map’s left side, or by clicking on the arrow that appears at bottom-left. As users progress, the map dynamically adjusts its zoom level and center point to display relevant locations for each narrative section.

Implementation Steps

To build a storytelling map, follow these steps:

  1. Create a CARTO.js map with one layer (following standard CARTO.js examples)
  2. Define map scenes using <section> HTML elements with data-scene attributes containing location information, coordinates, and descriptive content
  3. Build a layers object containing both your CARTO data layer and basemap
  4. Create a scenes object with individual scenes (scene1, scene2, etc.) that specify coordinates, zoom levels, layers, and names
  5. Initialize Storymap.js with your configuration settings

Storymap.js Initialization

Initialize the Storymap.js object with the following structure:

// initialize storymap
$('#storymap').storymap({
    scenes: scenes,
    layers: layers,
    baselayer: layers.basemap,
    legend: true,
    loader: true,
    flyto: false,
    scalebar: true,
    scrolldown: true,
    progressline: true,
    navwidget: true,
    createMap: function () {
        let map = L.map($(".storymap-map")[0], { zoomControl: false }).setView([30, 0], 3);
        // add basemap
        this.baselayer.layer.addTo(map);
        // add carto layer
        layers.cartoLayer.layer.addTo(map)
        return map;
    }
});

For comprehensive details, consult the Storymap.js library documentation.

CARTO
carto-logo
  • Platform

  • Overview

  • Visualization

  • Analytics

  • App Development

  • Data Enrichment

  • Security & Governance

  • Gen AI

  • Pricing

  • Solutions

  • Data Analyst

  • Developer

  • Data Scientist

  • GIS Professional

  • By Industry

  • By Use Case

  • Resources

  • Customer Stories

  • Blog

  • Glossary

  • Documentation

  • Academy

  • Reports

  • Events

  • Webinars

  • Partners

  • Company

  • About us

  • Newsroom

  • Careers

  • Brand

  • Grants

Unlock the power of spatial analysis.

youtube logofacebook logotwitter logolinkedin logo

© CARTO 2024

Terms

Privacy Notice

Whistleblower Form