Skip to content

fix: Vector tiles creating layers#325

Merged
bdjulbic merged 2 commits intomainfrom
fix/vector-tileset-creates-layers-automatically
Jan 27, 2026
Merged

fix: Vector tiles creating layers#325
bdjulbic merged 2 commits intomainfrom
fix/vector-tileset-creates-layers-automatically

Conversation

@bdjulbic
Copy link
Collaborator

@bdjulbic bdjulbic commented Jan 27, 2026

Issue: When creating vector tile using function Add as tiles to map, the vector tile is shown on every map, instead of that it should be added as layer only on active tab

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 27, 2026

Greptile Overview

Greptile Summary

Added an autoCreateLayers parameter to the addTileSetToMap function to control whether layers are automatically created when adding vector tiles to a map. The parameter defaults to true to maintain backward compatibility.

Key Changes:

  • Updated function signature to accept autoCreateLayers boolean parameter with default value true
  • Passed the parameter through to the addDataToMap action options
  • Updated TypeScript type definition for the function

This fixes the issue where vector tiles were being added to all maps instead of just the active tab. By setting autoCreateLayers to false, callers can now control layer creation behavior on a per-call basis.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The change is well-scoped and focused: adds a single optional parameter with a sensible default value that maintains backward compatibility. The implementation is straightforward, type-safe, and follows the existing codebase patterns. One minor style improvement suggested (using shorthand property notation), but not critical.
  • No files require special attention

Important Files Changed

Filename Overview
packages/kepler/src/KeplerSlice.ts Added autoCreateLayers parameter to addTileSetToMap function to control layer creation behavior, defaulting to true for backward compatibility

Sequence Diagram

sequenceDiagram
    participant UI as UI Component
    participant KS as KeplerSlice
    participant KR as Kepler Reducer
    participant Map as Kepler Map

    UI->>KS: addTileSetToMap(mapId, tableName, tileset, tileMetadata, autoCreateLayers)
    Note over UI,KS: autoCreateLayers defaults to true
    
    KS->>KS: registerKeplerMapIfNotExists(mapId)
    Note over KS: Register map in Redux if not exists
    
    KS->>KS: Build dataset object
    Note over KS: Includes tileset metadata and configuration
    
    KS->>KR: dispatchAction(mapId, addDataToMap())
    Note over KS,KR: Pass autoCreateLayers in options
    
    alt autoCreateLayers = true
        KR->>Map: Create layers for dataset
        Note over Map: Layers created on current map only
    else autoCreateLayers = false
        KR->>Map: Add dataset without creating layers
        Note over Map: Dataset added but no layers
    end
    
    Map-->>UI: Vector tile displayed with/without layers
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

1 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
@bdjulbic bdjulbic merged commit 132ee22 into main Jan 27, 2026
3 checks passed
@bdjulbic bdjulbic deleted the fix/vector-tileset-creates-layers-automatically branch January 27, 2026 19:20
dmitriy-kostianetskiy pushed a commit that referenced this pull request Jan 28, 2026
* add a flag for creating layers

* Update packages/kepler/src/KeplerSlice.ts

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

---------

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
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

Comments