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

Replace zoom limits with fewer details endpoint #563

Open
RyanTG opened this issue Nov 28, 2024 · 3 comments
Open

Replace zoom limits with fewer details endpoint #563

RyanTG opened this issue Nov 28, 2024 · 3 comments

Comments

@RyanTG
Copy link
Collaborator

RyanTG commented Nov 28, 2024

Overall goal:

Get rid of "zoom in" limit. Replace with a within_bounding_box?no_details=2 endpoint that returns fewer location/machine info, has no marker labels, and uses simpler marker styles.

Zoom thresholds

I think our current zoom thresholds (which are different depending on the filters applied) can be used as is. When a threshold is exceeded, instead of preventing refreshes, we switch the endpoint flag from no_details=1 to no_details=2.

no_details=2

The flag will only return:

  • location ID
  • location lat
  • location lon

When this flag is used, we should hide:

  • The List button
  • The "filter by machines shown on the map" option.

Marker clicks can still show the bottom sheet. Let's look into the location details (at least enough for the bottom sheet) being requested when a marker is clicked. We might need to make a new locations endpoint that is specific for the bottom sheet (for example, only returns the shown fields, including only the top 5 machines and not all machine IDs).

Map markers

The current CustomMapMarker component contains a lot of things that wouldn't be used when this flag is used.

Such as:

  • No labels (floating location names or number of machines).
  • Sort order is not necessary.

The marker icon will be a small simple white circle png. I'm still unsure if we'll show saved location map markers, but I'm leaning toward not so that we don't have to bother with sorting those above other markers. I guess it would still be good to have a "selected" marker.

The iconSize: ["interpolate", ["linear"], ["zoom"] will be different for these markers.

All this is to say that it may be worth creating a separate CustomMapMarker2 component or something that is used in this case.

@RyanTG
Copy link
Collaborator Author

RyanTG commented Jan 5, 2025

One potential alternative to only using Zoom thresholds to switch to the no_details=2 endpoint is to use a combo of zoom and the actual number of results. I think this would involve making two queries.

For example, say that you filter to a machine that isn't common, instead of switching to no_details=2 as you zoom out and showing the simplified info, you switch to no_details=2 in order to quickly check the quantity of locations in the request, and if it's lower than a certain threshold (300?), you then make a no_details=1 request for the same bounds and display that.

@bpoore
Copy link
Collaborator

bpoore commented Jan 7, 2025

@RyanTG, would the dual request option only kick in when we currently would be showing "Please zoom in"? I think we could make that work.

@RyanTG
Copy link
Collaborator Author

RyanTG commented Jan 7, 2025

Yes, that sounds right.

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

No branches or pull requests

2 participants