Skip to content

feat: Add InteractiveMap component using react‑leaflet#678

Merged
MichaelMilstead merged 17 commits intotambo-ai:mainfrom
revogabe:interactive-map
Jul 28, 2025
Merged

feat: Add InteractiveMap component using react‑leaflet#678
MichaelMilstead merged 17 commits intotambo-ai:mainfrom
revogabe:interactive-map

Conversation

@revogabe
Copy link
Contributor

Description

Adds a new InteractiveMap component to address issue #675. The component:

  • Renders an interactive map with pan and zoom via react‑leaflet
  • Accepts props:
    • markers: Array<{ lat: number; lng: number; label: string }>
    • Optional heatData: Array<[number, number, number]>
  • Displays tooltips on marker hover
  • Supports marker clustering when zoomed out
  • Uses zod schema for props validation
  • Integrates Tambo-specific streaming via useTamboComponentState, useTamboStreamingProps, useTamboStreamStatus, and TamboPropStreamProvider
  • Structured similarly to the existing graph.tsx example
  • Style Variations

Related Issue


Preview

Recording.2025-07-21.031339.mp4

Next Steps

  • Fix re-render component
  • Allow custom cluster icons
  • Optimize performance for large datasets

@vercel
Copy link

vercel bot commented Jul 21, 2025

@revogabe is attempting to deploy a commit to the tambo ai Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link

vercel bot commented Jul 21, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
showcase ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 28, 2025 1:58am
tambo-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 28, 2025 1:58am

@michaelmagan
Copy link
Contributor

michaelmagan commented Jul 21, 2025

The demo looks great! I wonder if we can show the map after the first pin is generated, and then upon each complete of a full pin we show it to to the graph?

I'm working on something similar for our graph component right now. We an swap notes tomorrow.

@michaelmagan michaelmagan changed the title Add InteractiveMap component using react‑leaflet feat: Add InteractiveMap component using react‑leaflet Jul 23, 2025
@revogabe
Copy link
Contributor Author

In my last commits I made some adjustments and we’re no longer seeing any errors. This is a temporary solution to handle Next.js, and we can look for a better way in the future to avoid this split between server-side and client-side.

@MichaelMilstead
Copy link
Contributor

looks like we have a ts-node dependency in package-lock that's needed for running tests, but it was removed from a package.json a while ago, so the new package-lock here doesn't contain it.

To get this PR through, how about we remove the package-lock changes and we can clean that up later

@alecf
Copy link
Member

alecf commented Jul 24, 2025

so in order to seperate out these issues, I just landed #703 which adds back ts-node. It seems like someone deleted the package-lock.json and then re-ran npm install which is generally not a good pattern (it can cause all sorts of sub-packages to update that you didn't intend)

My request for the above is:

  1. restore the original package-lock.json + various package.json files
  2. npm ci to make sure you get a clean package install
  3. npm install all the various leaflet libraries at the correct versions

that should make sure only the minimal changes are made to the various package*.json files.

@revogabe
Copy link
Contributor Author

I'm running into this same issue again after reverting back to react-leaflet v4. I remember this was the main reason I originally moved to v5. I'm trying to find a workaround, but so far nothing seems to work consistently.

image

PaulLeCam/react-leaflet#936
PaulLeCam/react-leaflet#1073

cc: @alecf

@revogabe
Copy link
Contributor Author

so in order to seperate out these issues, I just landed #703 which adds back ts-node. It seems like someone deleted the package-lock.json and then re-ran npm install which is generally not a good pattern (it can cause all sorts of sub-packages to update that you didn't intend)

My request for the above is:

  1. restore the original package-lock.json + various package.json files
  2. npm ci to make sure you get a clean package install
  3. npm install all the various leaflet libraries at the correct versions

that should make sure only the minimal changes are made to the various package*.json files.

done, but I’m still working on the issue I mentioned above.

@revogabe revogabe marked this pull request as draft July 25, 2025 16:01
@alecf
Copy link
Member

alecf commented Jul 25, 2025

@revogabe I found a few fixes - and I turned off strict mode for the showcase to let the map run - turns out strict mode for development is what is causing that map container error. As much as I'd like to use strict mode, turning it off is preferred to upgrading to react 19.

Please see my changes here:
https://github.com/tambo-ai/tambo/commits/interactive-map/

@revogabe revogabe marked this pull request as ready for review July 26, 2025 15:25
@revogabe
Copy link
Contributor Author

Nice! this works well and is stable for merged, we can work on improvements later. Thanks for the help @alecf

@MichaelMilstead MichaelMilstead merged commit 22b3862 into tambo-ai:main Jul 28, 2025
5 checks passed
@revogabe revogabe deleted the interactive-map branch July 28, 2025 17:16
MichaelMilstead pushed a commit that referenced this pull request Nov 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants