Skip to content

tilemaker v3#46

Open
jernestmyers wants to merge 7 commits intomainfrom
tilemaker-v3
Open

tilemaker v3#46
jernestmyers wants to merge 7 commits intomainfrom
tilemaker-v3

Conversation

@jernestmyers
Copy link
Copy Markdown
Collaborator

This updates the API in order to minimize initial load time by sending only the minimal JSON data needed for the client's layer menu and a default baselayer. Then, as a user navigates the client's layer menu, new endpoints send summaries for maps, bands, and layers that get rendered as respective children in the menu. A search endpoint also filters map groups in the server, and sends a tree and a list of matched IDs for the client's layer menu.

Note that we now only send detailed layer data when a layer is actually selected, since the data is not necessary for the layer menu itself.

@jernestmyers jernestmyers requested a review from JBorrow May 4, 2026 20:09
Copy link
Copy Markdown
Member

@JBorrow JBorrow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay, GitHub PR reviews were down...

Comment thread tilemaker/server/bands.py Outdated
Comment thread tilemaker/server/layers.py
Comment thread tilemaker/server/layers.py Outdated
Comment on lines +141 to +154
for map_group in request.app.config.map_groups:
if map_group.auth(request.auth.scopes):
for map in map_group.maps:
for band in map.bands:
for layer in band.layers:
if layer.layer_id == layer_id and map_group.auth(
request.auth.scopes
):
return LayerWithMenuState(
**layer.model_dump(),
map_group_id=map_group.map_group_id,
map_id=map.map_id,
band_id=band.band_id,
)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this would be best done with a pass over request.app.config.layers?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would require the Layer class to include the MenuState found in LayerWithMenuState. Adding a map_group_id has already invalidated old config files, so should we go ahead and refactor the generation.py logic to include the MenuState?

Comment thread tilemaker/server/search.py Outdated
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

Successfully merging this pull request may close these issues.

2 participants