Merged
Conversation
Member
giswqs
commented
Oct 25, 2025
This commit adds comprehensive support for the maplibre-three-plugin, enabling 3D model rendering on MapLibre maps using Three.js. Changes: - Added Three.js and GLTFLoader loading in maplibre_widget.js - Added maplibre-three-plugin library loading from jsDelivr CDN - Implemented JavaScript handlers for: - initMapScene: Initialize the MapScene for Three.js integration - addThreeModel: Load and display GLTF 3D models on the map - addThreeLight: Add lighting (ambient, directional, sun) to the scene - removeThreeModel: Remove 3D models from the scene - updateThreeModel: Update model properties (scale, rotation, position) - Added Python methods to MapLibreMap class: - init_three_scene(): Initialize the Three.js scene - add_three_model(): Add GLTF models with georeferencing - add_three_light(): Configure scene lighting - remove_three_model(): Remove models by ID - update_three_model(): Update model transformations - Created comprehensive example notebook demonstrating: - Basic 3D model integration - Multiple lighting configurations - Multiple models on a single map - Model updates and removal - Best practices and usage tips 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for the MapLibre Three.js plugin, enabling 3D model rendering and 3D Tiles visualization on MapLibre maps using Three.js and GLTF models.
- Adds JavaScript integration for Three.js, GLTFLoader, and the MapLibre Three Plugin
- Implements Python API methods for initializing 3D scenes, managing models, lights, and 3D Tiles datasets
- Provides comprehensive example notebook demonstrating various 3D rendering capabilities
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| docs/examples/maplibre_three_plugin_example.ipynb | Example notebook showcasing 3D model loading, lighting, and 3D Tiles rendering with various configurations |
| anymap/static/maplibre_widget.js | JavaScript implementation for loading Three.js dependencies, managing 3D objects, lights, and 3D Tiles rendering |
| anymap/maplibre.py | Python API methods for Three.js scene initialization, model/light management, and 3D Tiles operations |
Comments suppressed due to low confidence (1)
docs/examples/maplibre_three_plugin_example.ipynb:1
- Inconsistent environment variable name. Line 365 retrieves 'CESIUM_TOKEN' but line 367 instructs users to set 'CESIUM_ION_TOKEN'. These should match.
{
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| Example: | ||
| >>> m = MapLibreMap(center=[148.9819, -35.3981], zoom=18, pitch=60) | ||
| >>> m.init_three_scene() | ||
| >>> m.add_three_light(type='ambient') |
There was a problem hiding this comment.
The parameter name in the examples is incorrect. Should be light_type='ambient', light_type='directional', and light_type='sun' to match the function signature.
|
🚀 Deployed on https://68fc32dc366de650df09ec3c--opengeos.netlify.app |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.