Style selector example | CartoDB.js
✓ Published0🌍 Public
Aandrewxhill
Last edited May 6, 2014
Created on Jan 8, 2014
This example shows a map of U.S. ZIP code tabulation areas with an interactive layer selector that switches between three visual styles: a solid red fill, a black-and-white fill, and a choropleth based on the `aland10` attribute. The code uses the CartoDB.js library to load the visualization and applies different CartoCSS styles to the sublayer when the user clicks a menu item. It demonstrates dynamic style switching via `setCartoCSS`, with the choropleth style embedded as a template in the HTML.
AI-generated description