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

Open
becca0330 opened this Issue Jun 15, 2017 · 10 comments

Comments

Projects
None yet
9 participants
@becca0330
Copy link

becca0330 commented Jun 15, 2017

  • 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

This comment has been minimized.

Copy link
Author

becca0330 commented Jun 15, 2017

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).

@ralexsander

This comment has been minimized.

Copy link

ralexsander commented Aug 24, 2018

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

@ShayChris

This comment has been minimized.

Copy link

ShayChris commented Sep 11, 2018

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

@mariomka

This comment has been minimized.

Copy link

mariomka commented Nov 28, 2018

Same issue here. Any workaround?

@MarcGJA

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Author

becca0330 commented Jan 3, 2019

@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

This comment has been minimized.

Copy link
Author

becca0330 commented Jan 7, 2019

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

This comment has been minimized.

Copy link

Damienkopp commented Jan 24, 2019

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

@ricardobaehr

This comment has been minimized.

Copy link

ricardobaehr commented Feb 5, 2019

any perspective?

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment