Skip to content

Interactive Points

Demonstrates interactive features with detailed popups.

Click locations for details

Different colors for each category:

circle-color:
- match
- ["get", "category"]
- "government"
- "#6366f1" # Indigo for government
- "landmark"
- "#f59e0b" # Amber for landmarks
- "sports"
- "#22c55e" # Green for sports
- "#6b7280" # Gray fallback

Popups can contain multiple elements with mixed content:

interactive:
click:
popup:
- h3:
- property: name
- p:
- str: "📍 "
- property: address
- p:
- str: ""
- property: rating
- str: " / 5"

Change cursor on hover to indicate interactivity:

interactive:
hover:
cursor: pointer # Shows pointer cursor on hover

Each popup item is an object with:

  • Tag: HTML element (h3, p, div, etc.)
  • Content: Array of content items that can be:
    • { str: "text" } - Static text
    • { property: "name" } - Feature property value

Unicode characters work in popup text:

- p:
- str: "📍 "
- property: address

You can also change styling on hover:

interactive:
hover:
cursor: pointer
paint:
circle-radius: 18 # Grow on hover
circle-stroke-width: 4 # Thicker stroke