superset icon indicating copy to clipboard operation
superset copied to clipboard

Mapbox data visualization doesn't work

Open blcksrx opened this issue 7 years ago • 10 comments

Mapbox data visualization type doesn't show anything while it seems everything is okay!

Expected results

Mapbox map!

Actual results

Nothing

Screenshots

Screenshot from 2019-04-10 11-57-45

How to reproduce the bug

  1. Go to SQL Lab and write a query include latitude and longitude.
  2. Click on the 'explore' button
  3. choose the 'mapbox' as Visualization Type (also set latitude and longitude in query section)
  4. Click on the 'run query' button
  5. See nothing! (i mean the error)

Environment

latest official docker image

Checklist

Make sure these boxes are checked before submitting your issue - thank you!

  • [ ] I have checked the superset logs for python stacktraces and included it here as text if there are any.
  • [ ] I have reproduced the issue with at least the latest released version of superset.
  • [ ] I have checked the issue tracker for the same issue and I haven't found one similar.

Additional context

Add any other context about the problem

blcksrx avatar Apr 10 '19 07:04 blcksrx

Have you added your Mapbox API Key?

MarcusSorealheis avatar Apr 15 '19 04:04 MarcusSorealheis

Of course yes!

blcksrx avatar Apr 18 '19 08:04 blcksrx

You should save this .then into it.I guess it's a bug

XuanmoFeng avatar Apr 22 '19 09:04 XuanmoFeng

it doesn't work

blcksrx avatar Apr 22 '19 13:04 blcksrx

Confirmed, I noticed it's broken too

mistercrunch avatar Apr 22 '19 17:04 mistercrunch

Hi everyone,

Is it still broken in master or had been fixed?

Update: Confirm - Mapbox works - Point Radius - Auto.

GGPay avatar May 31 '19 04:05 GGPay

Hi everyone, I have setup API_Key on config file, but still not able to use mapbox in superset. sometimes getting error "An error occurred while rendering the visualization: TypeError: Cannot read property 'map' of undefined" and sometimes "An error occurred while rendering the visualization: TypeError: e.filter is not a function" I am very confused why getting two different errors? Any help is much appreciated. Thanks

garima301984 avatar Jul 22 '19 15:07 garima301984

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. For admin, please label this issue .pinned to prevent stale bot from closing the issue.

stale[bot] avatar Sep 20 '19 15:09 stale[bot]

In the docker-compose.yml file, environment block, you should add the Mapbox environment variable MAPBOX_API_KEY: {your_mapbox_api_token}. Once I included this I was able to see the maps when using a deck.gl visualization. I tested loading the deck.gl examples provided when the flag SUPERSET_LOAD_EXAMPLES is enabled.

If you check the config.py file, the token is obtained from the environment.

Another option could be to add the variable in the Dockerfile. However, this option will require you to specify the variable at build time, which means if you decide to use a different token you will have to rebuild the image.

lhsvobodaj avatar Oct 24 '19 12:10 lhsvobodaj

Hi, when i try to use mapbox with latitud and longitud from a datasource for example CSV file or a database like postgres, i can fine the map when i create the chat. However, when i try to to get data with latitud and longitud from SQL lab, i get this error when i use the mapbox chart: Traceback (most recent call last): File "/home/edgarubuntustudio/venv/lib/python3.6/site-packages/superset/views/base.py", line 120, in wraps return f(self, *args, **kwargs) File "/home/edgarubuntustudio/venv/lib/python3.6/site-packages/superset/utils/decorators.py", line 69, in wrapper return f(*args, **kwargs) File "/home/edgarubuntustudio/venv/lib/python3.6/site-packages/superset/views/core.py", line 1092, in explore_json viz_obj, csv=csv, query=query, results=results, samples=samples File "/home/edgarubuntustudio/venv/lib/python3.6/site-packages/superset/views/core.py", line 1013, in generate_json payload = viz_obj.get_payload() File "/home/edgarubuntustudio/venv/lib/python3.6/site-packages/superset/viz.py", line 381, in get_payload payload["data"] = self.get_data(df) File "/home/edgarubuntustudio/venv/lib/python3.6/site-packages/superset/viz.py", line 2059, in get_data point_radius_col, File "/home/edgarubuntustudio/venv/lib/python3.6/site-packages/superset/viz.py", line 2055, in for lon, lat, metric, point_radius in zip( TypeError: type str doesn't define round method

Y try to cast the latitud and longitud in the SQl in SQL Lab of this ways, but i get the same error: 1. to_number(lat, '###,######') lat, to_number(lng, '###,######') lng, 2. cast(lat as decimal(28,6) ) lat, cast(lng as decimal(28,6) ) lng,

3. 5 lat, 5 lng

Does anyone know how I can correct this?

Regards,

omejiasq avatar Apr 09 '20 23:04 omejiasq