Skip to content

Add indoor#774

Open
digitaltom wants to merge 4 commits into
mainfrom
add_indoor
Open

Add indoor#774
digitaltom wants to merge 4 commits into
mainfrom
add_indoor

Conversation

@digitaltom
Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings May 24, 2026 09:46
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 IndoorLayer with 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_KEY to 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.

Comment thread app/javascript/maplibre/layers/indoor/styles.js Outdated
removeStyleLayers(this.sourceId)
this.removeLevelDetection()
this.removeLevelControl()

Comment thread app/javascript/maplibre/layers/indoor/indoor.js
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
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.

Comment thread CHANGELOG.md
* 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 {
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