Incubator-superset: Cannot add new country to CountryMap chart

Created on 12 Dec 2019  路  5Comments  路  Source: apache/incubator-superset

I was trying add new country following to https://superset.apache.org/visualization.html#need-to-add-a-new-country, however it doesn't work - new country is visable in dropdown, but when I click on it, map is blank.

Expected results

Can display new added map from .geojson

Actual results

image

I get 404 when I click new country on dropdown map is fetching:

Request URL: http://localhost:5000/superset/explore/undefined
Status Code: 404 NOT FOUND

Other (default) maps works properly:

Request URL: http://localhost:5000/static/assets/dist/5f64d14062abb5f5fd6610972976ebe6.geojson
Status Code: 200 OK

I was able to resolve this issue by editing assets/node_modules/@superset-ui/legacy-plugin-chart-country-map/countries.js and add .geojson file to this directory. So it means that maps are fetched from npm package?

How to reproduce the bug

https://superset.apache.org/visualization.html#need-to-add-a-new-country

Environment

  • superset version: 0.999.0dev
  • python version: Python 3.7.5
  • node.js version: v12.12.0
  • npm version: 6.11.3

I built superset from source.

#bug inactive

Most helpful comment

Issue-Label Bot is automatically applying the label #bug to this issue, with a confidence of 0.92. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

All 5 comments

Issue-Label Bot is automatically applying the label #bug to this issue, with a confidence of 0.92. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

I was able to resolve this issue by editing assets/node_modules/@superset-ui/legacy-plugin-chart-country-map/countries.js and add .geojson file to this directory. So it means that maps are fetched from npm package?

I needed to add a map and this was the only working way that I found.

It would be possible to have a way to add a new map instead of building it from source? There is some workaround?

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.

hello, I want to get city of guangdong province,how can I do.Can you help me?
image

I just submitted a PR to update the docs for this: https://github.com/apache/incubator-superset/pull/10621 based on this comment and successfully going through the process. Hopefully it will be merged and save others the trouble that I've had to go through to get this working!

Was this page helpful?
0 / 5 - 0 ratings