ankane / blazer

Business intelligence made simple
MIT License
4.56k stars 474 forks source link

Multiple maps on a single Blazer dashboard #365

Closed ilikeike530 closed 3 years ago

ilikeike530 commented 3 years ago

First of all, great app - thank you for creating and supporting such a useful tool.

I am using Ahoy to track visits and Blazer to create a query of those visits with latitude and longitude (using Mapbox to plot the location of each visit on a map). Everything works fine for a single map on a Blazer dashboard.

Issue detail

When I add a 2nd map to the same Blazer dashboard, the map is blank and I receive an error in the browser console: "Uncaught Error: Map container is already initialized." Changing the order of the maps within the dashboard consistently results in the 1st map being loaded correctly, and the subsequent map(s) not loading.

To recreate

Add any 2 map charts to the same dashboard.

Questions/unknowns

  1. Can anyone else replicate this behavior?
  2. Should a single dashboard be able to display multiple maps?
  3. Is this an issue with mapbox.js itself, rather than something that be corrected here?

I appreciate your thoughts and input.

ankane commented 3 years ago

Hey @ilikeike530, thanks for reporting! Fixed in the commit above.

ilikeike530 commented 3 years ago

Works perfectly @ankane! Thanks for the incredibly fast fix!