Questions  /  Building Maps  /  Development

How can I open a popup when clicking on a button with CARTO.js?

Learn how to assign a open popup action to a button in a CARTO.js application.

This simple example shows how to open CARTO.js popup when clicking on an HTML element such as a button. Basically, it uses the SQL API using Axios to get the coordinates and other thematic information, and opens a Leaflet popup displaying that data as content.