Skip to content

Improve add_tile_layer method#117

Merged
giswqs merged 1 commit intomainfrom
layer
Nov 8, 2025
Merged

Improve add_tile_layer method#117
giswqs merged 1 commit intomainfrom
layer

Conversation

@giswqs
Copy link
Copy Markdown
Member

@giswqs giswqs commented Nov 8, 2025

No description provided.

Copilot AI review requested due to automatic review settings November 8, 2025 04:37
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Nov 8, 2025

@github-actions github-actions Bot temporarily deployed to pull request November 8, 2025 04:38 Inactive
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

This PR removes two methods (get_style() and get_style_layers()) from the MapLibreMap class and refactors the add_tile_layer() method to improve code organization and parameter handling.

  • Removes get_style() and get_style_layers() methods (lines 1083-1126 in the original file)
  • Refactors add_tile_layer() to explicitly handle attribution, minzoom/maxzoom, and pass opacity/visible parameters to add_layer()
  • Improves code clarity in add_tile_layer() with better separation of source and layer configuration
Comments suppressed due to low confidence (1)

anymap/maplibre.py:1

  • Removing these methods will break the code as they are actively used in multiple locations. In maplibre.py, get_style_layers() is called on line 199 (in __init__), line 298 (in find_style_layer), line 311 (in find_first_symbol_layer), line 977 (in set_visibility), and line 995 (in set_opacity). Additionally, it's used in maplibre_widgets.py on line 864. These methods must be retained or all call sites must be updated with alternative implementations.
"""MapLibre GL JS implementation of the map widget.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@giswqs giswqs merged commit 4e6d56d into main Nov 8, 2025
14 checks passed
@giswqs giswqs deleted the layer branch November 8, 2025 04:40
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