superset icon indicating copy to clipboard operation
superset copied to clipboard

Cannot add new country to CountryMap chart

Open bartmichalak opened this issue 6 years ago • 5 comments

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.

bartmichalak avatar Dec 12 '19 07:12 bartmichalak

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.

issue-label-bot[bot] avatar Dec 12 '19 07:12 issue-label-bot[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?

PeterCahn avatar Dec 16 '19 11:12 PeterCahn

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 Feb 14 '20 11:02 stale[bot]

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

Sandwichzhao avatar Apr 01 '20 09:04 Sandwichzhao

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!

czue avatar Aug 17 '20 13:08 czue