feat(#33): скейл на регионы — фильтр по области + переключатель - #104
Merged
Merged
Conversation
* feat(#33): region filter for structures/geojson/stats + regions endpoint Add a 'region' filter (top-level AdminUnit) reusing the #11 filter mechanism: StructureFilter.filter_region matches the region plus all descendant districts and okrugs, so it flows through /structures, the GeoJSON feed and every /stats/* aggregate automatically. New GET /api/v1/regions/ lists regions with object counts (the scaling mechanism — new regions are new KATO rows). * feat(#33): region switcher in header + map recenter on region change Isolated RegionSwitcher (header) reads /regions/ and writes the 'region' URL param, defaulting to Жамбылская область once on load. Map and catalog already forward the full query string, so the scope applies everywhere; MapPage gains a small FitOnRegion helper that fits bounds to the loaded features when the region changes. Labels are local to the control — no shared dictionaries touched. --------- Co-authored-by: Adilforest <rzhunusov@thesirius.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #33
Что сделано
region(область верхнего уровня) для/structures, GeoJSON и всех/stats/*; эндпоинт/api/v1/regions/со счётчиком объектов.Основные изменения
StructureFilter.filter_region: матчит саму область + все дочерние районы и округа (КАТО-дерево), переиспользует механизм фильтров Фильтры и поиск на карте #11 — параметр автоматически работает в списке, GeoJSON и агрегатах.RegionsView(/api/v1/regions/): список областей с количеством объектов (включая потомков) — механизм масштабирования (новый регион = новые строки КАТО).RegionSwitcherизолирован (свои подписи, без правки общих словарей/компонентов UI гос-флоу #30); пишет только параметрregionв URL. Карта и каталог уже прокидывают весь query string.FitOnRegionв MapPage перецентрирует карту по объектам выбранного региона, не мешая обычной фильтрации.Зачем это сделано
Демонстрирует масштабируемость на другие регионы Казахстана: одна архитектура, регион — это срез данных, а не новая система.