Add indoor#774
Open
digitaltom wants to merge 4 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an optional “indoor” layer type backed by Indoorequal vector tiles, including UI to create the layer, MapLibre rendering + level switching control, and small UI tweaks to treat indoor layers similarly to raster layers in the layers modal.
Changes:
- Introduces a new MapLibre
IndoorLayerwith vector-tile source creation, style layers, and automatic floor-level detection + selector UI. - Wires indoor layer creation into the layers modal + layer factory, and exposes
INDOOREQUAL_KEYto the frontend as a provider key. - Updates layers modal behavior/styling (non-expandable, no feature counts) and adds UI styling for the new level control.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
CHANGELOG.md |
Documents the new indoor layer feature and removes a duplicate entry. |
app/views/maps/modals/_layers.haml |
Adds a conditional UI entry to create an indoor layer when INDOOREQUAL_KEY is set. |
app/models/map.rb |
Exposes INDOOREQUAL_KEY via provider_keys for frontend use. |
app/javascript/maplibre/layers/indoor/styles.js |
Defines MapLibre style layers for indoor vector tiles. |
app/javascript/maplibre/layers/indoor/indoor.js |
Implements the IndoorLayer (vector source, styles, level detection, level control lifecycle). |
app/javascript/maplibre/layers/indoor/control.js |
Adds a custom DOM control for switching indoor levels. |
app/javascript/maplibre/layers/factory.js |
Registers the new indoor layer type. |
app/javascript/maplibre/edit.js |
Adjusts draw touch buffer configuration. |
app/javascript/maplibre/controls/shared.js |
Treats indoor layers like raster layers for counts/expandability messaging in the layers modal. |
app/javascript/controllers/map/layers_controller.js |
Adds a controller action to create indoor layers from the UI. |
app/assets/stylesheets/controls.css |
Adds CSS for the indoor level control UI. |
Comments suppressed due to low confidence (1)
app/javascript/maplibre/layers/indoor/indoor.js:104
- setupLevelDetection() runs querySourceFeatures() on every map 'idle' event. Idle can fire frequently, and querying source features each time can become expensive. Consider debouncing/throttling, switching to a less frequent trigger (e.g., 'sourcedata' / 'moveend'), and/or removing the listener once levels have been detected for the current viewport.
setupLevelDetection() {
this.idleHandler = () => {
if (!this.show) return
if (!map.getSource(this.sourceId)) return
// Query source features directly to get ALL levels, not just currently filtered ones
const levelSet = new Set()
try {
const features = map.querySourceFeatures(this.sourceId, {
sourceLayer: 'area'
})
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| removeStyleLayers(this.sourceId) | ||
| this.removeLevelDetection() | ||
| this.removeLevelControl() | ||
|
|
Comment on lines
+20
to
+25
| set show(value) { | ||
| this.layer.show = value | ||
| if (this.levelControl) { | ||
| value ? this.levelControl.show() : this.levelControl.hide() | ||
| } | ||
| } |
* origin/main: allow satellite zoom 18.5 render raster layers below geojson allow more detailed selection in edit mode on touch device Update puppeteer-ruby to version 0.52.1 upate bootsnap update to Ruby 4.0.5 Update stylelint to version 17.12.0 Update selenium-webdriver to version 4.44.0 Update Ruby to version 4.0.4
| * Switched headline font to "Bree Serif" | ||
| * Enhanced waymarkedtrails.org integration: | ||
| Select and copy trails to your map | ||
| * Add indoor layer (vector data from [indoorequal](https://indoorequal.org/)) |
Comment on lines
+44
to
+47
| console.log('Indoor layer: creating source with API key') | ||
| map.addSource(this.sourceId, { | ||
| type: 'vector', | ||
| tiles: [`https://tiles.indoorequal.org/tiles/{z}/{x}/{y}.pbf?key=${apiKey}`], |
Comment on lines
+108
to
+112
| this.idleHandler = () => { | ||
| // Query source features directly to get ALL levels, not just currently filtered ones | ||
| const levelSet = new Set() | ||
|
|
||
| try { |
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.
No description provided.