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

Optimisation: Improve payload size for bundled toiletmap geohash tiles #1452

Open
ob6160 opened this issue Mar 4, 2023 · 0 comments
Open

Comments

@ob6160
Copy link
Member

ob6160 commented Mar 4, 2023

  • When users are zoomed quite far out on the map, we still request the full list of compressed toilets for that tile. As all of these toilets are bundled under a single marker with a count in it, all we need to send to the client technically is a count of all of the toilets in the tile and the filter information

Illustrated example:

The API request for map tiles inside the geohash chunk gcp: loosByGeohash(geohash: "gcp").
This returns:

{
  "data": {
    "loosByGeohash": [
      "d22dc2b7d54fbb051da3ec7a|gcpvqkenb|49",
      "a8567086272989f6f06aa058|gcpvqm6xe|1",
      "b2725a08106421713fa6f0f1|gcpvqmg5g|1",
      "709f062960c8bc7bdeafafc3|gcpvq8gqw|1",
      "10c29fc18441c37efdbc34e1|gcpvqqgfg|1",
      "4468c8529e2376da9c205a02|gcpvqxk7e|49",
      "aa3c3472650826b8888f347a|gcpvqq33y|1",
      "0f08412b247e2e35a9c7cd18|gcpvqeu7w|25",
      "83c0a588c695fc3eb898060a|gcpvq43n2|57",
      "30afad2199fdbd607614dbbc|gcpvq09sk|39",
      "90790b0b22360453da4a34df|gcpvqw5m4|0",
      "d8eacfc55052ba8870507387|gcpvqfd78|0",
      "95830cff872de065172ca72e|gcpvqybe0|9"
.... many more records
    ]
  }
}

This change proposes that we extend the API to only return the count of loos, instead of the information - because it won't be rendered until the user zooms in further.

Some questions will need to be answered about how we can tell if all of the loos inside of the geohash tile will be rendered in a bundle by Leaflet, as this will determine whether we ask for the count request or not.

I'm pretty sure that we can use this technique safely for when users are zoomed out quite far.. in scenarios like this:

Screenshot 2023-03-04 at 19 19 24

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

No branches or pull requests

1 participant