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

Cannot set default latitude/longitude in MapBox chart #17269

Open
3 tasks done
frafra opened this issue Oct 28, 2021 · 14 comments · May be fixed by #26736
Open
3 tasks done

Cannot set default latitude/longitude in MapBox chart #17269

frafra opened this issue Oct 28, 2021 · 14 comments · May be fixed by #26736
Labels
#bug Bug report

Comments

@frafra
Copy link
Contributor

frafra commented Oct 28, 2021

How to reproduce the bug

  1. Create a new Chart
  2. Select MapBox
  3. Select latitude and longitude
  4. Click on Customize
  5. Zoom and pan on the map

Expected results

Change viewport default parameter.

Actual results

Latitude and longitude do not change, while the zoom parameter is glitchy.

Environment

  • browser type and version: Firefox 93
  • superset version: superset version the latest Superset from Docker

Checklist

Make sure to follow these steps before submitting your issue - thank you!

  • I have checked the superset logs for python stacktraces and included it here as text if there are any.
  • I have reproduced the issue with at least the latest released version of superset.
  • I have checked the issue tracker for the same issue and I haven't found one similar.
@frafra frafra added the #bug Bug report label Oct 28, 2021
@srinify
Copy link
Contributor

srinify commented Dec 12, 2021

Hi @frafra what would help here is a screenshot or video of the issue. Without this, it's going to be quite hard for anyone here to help out.

@frafra
Copy link
Contributor Author

frafra commented Dec 13, 2021

@srinify it looked easy to reproduce to me (just try to set a different latitude on a map, nothing happens), but I will send a video as requested.

@frafra
Copy link
Contributor Author

frafra commented Dec 13, 2021

2021-12-13.11-19-01.mp4

As you can see, panning does not change latitude/longitude. Writing custom coordinates does not have any effect, even if the widget is saved and reloaded. The zoom glitches when zooming in.

@beersweetpicklepanda
Copy link

Can confirmed as well, Docker Superset 1.3.0

@stale
Copy link

stale bot commented Apr 17, 2022

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 stale bot added the inactive Inactive for >= 30 days label Apr 17, 2022
@frafra
Copy link
Contributor Author

frafra commented Apr 17, 2022

Still valid.

@stale stale bot removed the inactive Inactive for >= 30 days label Apr 17, 2022
@mike-fischer1
Copy link

still an issue

@mike-fischer1
Copy link

any updates?

@JakobMiksch
Copy link
Contributor

I can reproduce it as well

@JakobMiksch
Copy link
Contributor

JakobMiksch commented Nov 23, 2022

The problem seems to be here:

onViewportChange({ latitude, longitude, zoom }) {
setControlValue('viewport_longitude', longitude);
setControlValue('viewport_latitude', latitude);
setControlValue('viewport_zoom', zoom);
},

only the last call of setControlValue seems to be executed, the other calls are getting lost

@JakobMiksch
Copy link
Contributor

There seems to be a similar issue with the Deck.GL plugin. The popover of the Viewport-control does not properly update either.
image

@JohnDietrich-Pepper
Copy link

Yep this is an issue in Deck.Gl as well. Would be nice to be able to set the default view.

@jseparovic
Copy link

The lat/long/zoom values are not being used as the initial set of values when the component loads. Instead the bounds are used to calculate the viewport.
I've added a control setting to switch from this behavior "Auto" to using "Fixed" values based on the lat/long/zoom in the viewport settings.
image

I was also thinking that the setControlValue call should be saving the viewport settings when the map is dragged, so I thought an additional settings called "User" would be good to remember the User's dragged lat/long/zoom. However, it wasn't quite working as I expected and didn't seem to update the viewport settings properly.

I also noticed that on first load after login, the plots show up ok on the map, but if you click to another dashboard and then back again, the plots do not show up until you drag the map. This was due to clusters not being tracked in react state. I updated the component to an FC and fixed this issue by add clusters to useState.

There's still one more issue when looking at the world map and scanning left or right. When a plot disappears out of screen and then the same location shows up on the other side of the screen, the plot does not appear as soon as the location is visible.

Here is the map I'm expecting:
image

After dragging to the left:
image

Looks like the plot calculation needs to be updated to fix this issue. Possibly to create duplicate plots so if the location is visible twice on the map, the plot shows up twice. This can happen when zooming all the way out.

@rusackas
Copy link
Member

I assume folks are still facing this... code reviews on the linked PR are more than welcome :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
#bug Bug report
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants