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

Clarification on tile size displayed in showTileBoundaries option #8376

Closed
tristen opened this issue Jun 21, 2019 · 7 comments
Closed

Clarification on tile size displayed in showTileBoundaries option #8376

tristen opened this issue Jun 21, 2019 · 7 comments

Comments

@tristen
Copy link
Member

tristen commented Jun 21, 2019

mapbox-gl-js version: v1.0.0

Question

It's not clear to me what the tile size represents. For instance:

  • Does this represent the compressed or uncompressed tile size?
  • Does this number represent all tilesets when a style isn't composited?

It also looks like its missing an explanation where its documented:

Gets and sets a Boolean indicating whether the map will render an outline around each tile. These tile boundaries are useful for debugging.

Links to related documentation

https://jsfiddle.net/6ga8ofpd/embedded/result/?username=tristen

@asheemmamoowala
Copy link
Contributor

Does this represent the compressed or uncompressed tile size?

The size is the Uncompressed raw bytes

Does this number represent all tilesets when a style isn't composited?

It represents the size of just one source's tileset. If that is a composited tileset, then it will include the size of the entire composite.

if (this.options.showTileBoundaries) {
for (const id in sourceCaches) {
draw.debug(this, sourceCaches[id], coordsAscending[id]);
break;
}
}

@tristen
Copy link
Member Author

tristen commented Jun 21, 2019

👍 thanks @asheemmamoowala! can we document this under its entry in the API docs?

It represents the size of just one source's tileset. If that is a composited tileset, then it will include the size of the entire composite.

For un-composited styles, how does it decide which source to use? Would it be worth including the name of the tileset in the debug display as well?

@andrewharvey
Copy link
Collaborator

My original intent in #7963 was for it to include the size all sources together. This gets complicated when you mix tileSize's eg. 256 satellite tiles with 512 vector tiles, but if someone want's to add support for that then I'm okay, but I don't see it as super important.

From my testing it seems to take the first source, but I don't know if that's guaranteed.

I'm okay with documenting it, but so long as that doesn't stop us from changing it in the future to include all sources.

@andrewharvey
Copy link
Collaborator

I attempted to include the tile size for all sources in https://github.com/mapbox/mapbox-gl-js/tree/show-debug-tile-size-sum. It might need to be cleaned up and I'll need to test it more for a wider variety of cases, but do you think we should aim to get this changed rather than documenting the current situation?

I think we can still document that it's uncompressed tile size.

@andrewharvey
Copy link
Collaborator

I attempted to include the tile size for all sources in https://github.com/mapbox/mapbox-gl-js/tree/show-debug-tile-size-sum.

I just discovered #7314, at some point we'll need to merge these.

@asheemmamoowala
Copy link
Contributor

I attempted to include the tile size for all sources [...] do you think we should aim to get this changed rather than documenting the current situation?

I'm not sure the tile debug mode should be overloaded with all this hard to read information. Tile size can be easily inspected in the browser network tools. Only vector tiles have the rawTileData property, so summing size for all sources will still need an explanation.

Given these complexities, either tile size should be listed per source or left as-is.

@andrewharvey
Copy link
Collaborator

The original issue was resolved by updating the docs in #8379, so I'll close this now. Can follow up on how we should treat multiple source sizes in another issue or PR.

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

No branches or pull requests

3 participants