Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embed dashboard does not display Map charts #5338

Closed
becca0330 opened this issue Jun 15, 2017 · 15 comments
Closed

Embed dashboard does not display Map charts #5338

becca0330 opened this issue Jun 15, 2017 · 15 comments
Assignees
Labels
Embedding/ Use this label when unsure which flavor of embedding is impacted Priority:P2 Average run of the mill bug Reporting/Dashboards Type:Bug Product defects
Milestone

Comments

@becca0330
Copy link

  • Your browser and the version: Chrome 58.0.3029.110 & safari 10.10.1
  • Your operating system: OS X 10.10.5
  • Your databases: Oracle
  • Metabase version: 0.23.1
  • Metabase hosting environment: CentOS 6
  • Metabase internal database: MySQL

My map charts shows correctly on the dashboard, however if I embed the dashboard to my own site it keeps loading and never get the map shown. (Other chart types works fine, and also if I change to use public iframe, it works, too. Only the "embeded" one didn't. )

Please see the attached images.

The correct map chart on the metabase dashboard:
map_on_dashboard_is_displayed

The keep-loading map chart on the embeded dashboard:
map_on_embeded_dashboard_is_not_displayed

Error I got from chrome developer tools
chrom_developer_tools_message

GET http://my.site.com/api/user/current 401 (Unauthorized)
GET http://my.site.com/api/geojson/622ed923-9686-5ff7-f1a2-6f40af4d1026 401 (Unauthorized)

Could anyone help me with this or give some hint?

@becca0330
Copy link
Author

I found that if I login the metabase site, the embeded dashboard on the other site shows the map chart correctly. If I logout the metabase site, then the map chart on the other site is gone ( the other charts are still fine).

@mazameli mazameli added Type:Bug Product defects Reporting/Dashboards Embedding/ Use this label when unsure which flavor of embedding is impacted labels Jun 15, 2017
@salsakran salsakran added the Priority:P2 Average run of the mill bug label Jul 10, 2017
@ralexsander
Copy link

Exactly same problem here. @becca0330 you was able to find a workaround without requiring user to log in metabase?

@ShayChris
Copy link

Can I ask you how do you add china map?I add a geojson url but it isn't work

@mariomka
Copy link

Same issue here. Any workaround?

@MarcGJA
Copy link

MarcGJA commented Jan 2, 2019

Thanks to @flamber for posting this! Had I seen this post before I probably wouldn't have posted my own:
Embedded GeoJson Maps Not Resolving (GitHub Issue #9193), and
Embedded GeoJson Maps Not Resolving (Metabase Discussion)

This is a serious issue, maps are an absolute "must have"!

@MarcGJA
Copy link

MarcGJA commented Jan 3, 2019

GeoJsons do in fact resolve in vintage FireFox 52.9.0 albeit with "peek-a-boo" labels. See the illustrations in the Metabase Discussion forum topic Embedded GeoJson Maps Not Resolving scrolling about half-way down. Notice the labels peeking out from behind the Map Question Embeds. Curiously Dashboards with the same Questions resolved without any label problems at all!

That was then, whenever FireFox 52.9.0 was released. Today with FireFox 64+, Chrome 71+, IE 11+, etc. -- nothing, GeoJsons do not resolve in Embedded Questions or Dashboards at all! So something changed, for it to have largely worked in the past is a very good indicator that it can be made to work again. The culprit is probably in the Embed generation code...

@becca0330
Copy link
Author

@ShayChris

if you haven't found one for the china geojson, this url should works:
https://raw.githubusercontent.com/longwosion/geojson-map-china/master/china.json

@becca0330
Copy link
Author

A "very ugly and not secured" workaround for those who really need to embed the map....

Since I guess this is an authentication issue ( error I got from chrome developer tools says "Unauthorized"), I try to load the page as a metabase logged user in the background by calling metabase api ( your-metabase-url/api/session ) and setting cookie and session, then the embedded map is displayed.

Again, there is strong security risk by doing so, if your application is not for internal use, I don't recommend you to do this way.

@Damienkopp
Copy link

Honestly a shame that it's been open for 1year+!!!

@ricardobaehr
Copy link

any perspective?

I'm evaluating the metabase to use with whitelabel and show the maps without authentication is essential :/

@MarcGJA
Copy link

MarcGJA commented Apr 6, 2019

@ricardobaehr Check this post comment out if you haven't already, #6593. Evidently the auth issue can be cleared up by changing one line of clj code. Haven't tried it myself yet, I have to learn how to use Docker first to get it on AWS. But it sounds doable.

@camsaul camsaul marked this as a duplicate of #5338 Apr 10, 2019
@camsaul camsaul closed this as completed Apr 10, 2019
@camsaul camsaul reopened this Apr 10, 2019
@camsaul camsaul self-assigned this Apr 10, 2019
@camsaul camsaul added this to the 0.32.5 milestone Apr 10, 2019
@camsaul
Copy link
Member

camsaul commented Apr 10, 2019

Easy fix

@mirek-resq
Copy link

mirek-resq commented Apr 15, 2019

Easy fix for bug preventing people not-logged in Metabase to see custom maps. In the metabase/api/routes.clj file

(context "/geojson" [] (+auth geojson/routes))

change to

(context "/geojson" [] geojson/routes)

@camsaul
Copy link
Member

camsaul commented Apr 17, 2019

Fixed by #9807

@camsaul camsaul closed this as completed Apr 17, 2019
@camsaul
Copy link
Member

camsaul commented Apr 20, 2019

Hi everyone, this is fixed in Metabase 0.32.5 which has just been released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Embedding/ Use this label when unsure which flavor of embedding is impacted Priority:P2 Average run of the mill bug Reporting/Dashboards Type:Bug Product defects
Projects
None yet
Development

No branches or pull requests