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

Issue with image encoding on maps #7295

Closed
xoolive opened this issue Mar 10, 2021 · 6 comments
Closed

Issue with image encoding on maps #7295

xoolive opened this issue Mar 10, 2021 · 6 comments
Labels
Area - Map Bug 🐛 P3 Should be fixed at some point

Comments

@xoolive
Copy link

xoolive commented Mar 10, 2021

This issue is probably related to #6580 and comes after further investigation after this question on StackOverflow: https://stackoverflow.com/questions/66556550/plotting-image-on-maps-with-vega-lite-altair

The code below does not display the images. In the Vega (not lite) editor, it seems:

Editing the corresponding code in the Vega editor accordingly seems to fix the issue:

		  "x": {"field": "layer_1_x"},
          "y": {"field": "layer_1_y"},
          "width": {"value": 60},
          "height": {"value": 60},

Working link with Vega
Not working link with Vega-Lite

{
  "config": {"view": {"continuousWidth": 300, "continuousHeight": 400}},
  "layer": [
    {
      "mark": {"type": "text", "font": "Ubuntu", "fontSize": 18},
      "encoding": {
        "latitude": {"field": "latitude", "type": "quantitative"},
        "longitude": {"field": "longitude", "type": "quantitative"},
        "text": {"type": "nominal", "field": "name"}
      }
    },
    {
      "mark": {"type": "image", "height": 60, "width": 60},
      "encoding": {
        "latitude": {"field": "latitude", "type": "quantitative"},
        "longitude": {"field": "longitude", "type": "quantitative"},
        "url": {"type": "nominal", "field": "url"}
      }
    }
  ],
  "data": {"name": "data"},
  "$schema": "https://vega.github.io/schema/vega-lite/v5.0.0.json",
  "datasets": {
    "data": [...]
  }
}
@domoritz domoritz added Area - Map P3 Should be fixed at some point labels Mar 10, 2021
@domoritz
Copy link
Member

domoritz commented Mar 10, 2021

It looks like we don't handle images correctly with geo coordinates. Thanks for the bug report.

x and y work correctly Open the Chart in the Vega Editor

long/lat do not Open the Chart in the Vega Editor

We need to update https://github.com/vega/vega-lite/blob/master/src/compile/mark/encode/position-rect.ts.

@xoolive
Copy link
Author

xoolive commented Mar 10, 2021

Thanks for the pointer. I'm pretty Javascript illiterate but this could be the occasion, esp. if you tell me where to look.

I'll give it a try

@domoritz
Copy link
Member

I think this is a duplicate of #6580, though.

@xoolive
Copy link
Author

xoolive commented Mar 10, 2021

Indeed @domoritz the same fix works there as well.

@domoritz
Copy link
Member

I think #7296 fixes it.

@xoolive
Copy link
Author

xoolive commented Mar 10, 2021

Thanks, looking forward to try it in next release!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area - Map Bug 🐛 P3 Should be fixed at some point
Projects
None yet
Development

No branches or pull requests

2 participants