Commit 914c3d2
chore(mapbox): Remove internal deck mode from
* chore(mapbox): Remove internal deck mode from MapboxLayer
MapboxLayer is no longer a public API (only MapboxOverlay is exported),
so the internal deck mode code paths are no longer needed.
Changes:
- Remove `isExternal` flag from UserData (always true now)
- Remove internal deck creation branch in getDeckInstance
- Remove `updateLayers` function (only used for internal mode)
- Make `deck` prop required in getDeckInstance
- Simplify MapboxLayer and MapboxLayerGroup to read map.__deck directly
- Only MapboxOverlay calls getDeckInstance for initialization
- Update tests to simulate MapboxOverlay flow
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* refactor(mapbox): Use getter for deck in MapboxLayer and MapboxLayerGroup
Replace `this.deck` field with a getter that reads from `map.__deck`
directly. This avoids potential stale references and simplifies the
lifecycle - `onAdd` no longer needs to capture the deck instance.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix(mapbox): Keep non-null assertions in render method
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* refactor(mapbox): Make __deck non-optional in MapWithDeck type
Since MapboxLayer and MapboxLayerGroup are internal classes only used
by MapboxOverlay, and MapboxOverlay always sets up map.__deck before
adding these layers, __deck is guaranteed to exist when the map is set.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* refactor(mapbox): Remove deck getter, access map.__deck directly
Since __deck is guaranteed on MapWithDeck, we can access it directly
through the map rather than through a getter.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* test(mapbox): Remove trivial deck instance assertions
These assertions just verified getDeckInstance set map.__deck, which
is obvious and doesn't test any MapboxLayer behavior.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix(mapbox): Restore original test structure for external Deck
The first test should create Deck without gl option to test the case
where deck has its own gl context. This matches the original test
behavior where deck.props.gl !== map's gl.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix(mapbox): Initialize map.__deck in tests before using MapboxLayer
The resolveLayers test now calls getDeckInstance to set up map.__deck
before resolving layers, since MapboxLayer.onAdd expects it to be set.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* refactor(mapbox): Consolidate gl context handling in getDeckInstance
- Remove `gl` parameter from getDeckInstance - now obtained internally from map.painter.context.gl
- Remove always-true `if (deck.props.gl === gl)` condition since deck is always created without gl and getDeckInstance sets it
- Move WebGL1 compatibility warning from MapboxOverlay to getDeckInstance
- Simplify MapboxOverlay._onAddInterleaved - just creates Deck with user props
- Update tests to not pass gl when creating Deck instances
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix(mapbox): Pass gl at Deck construction time, not via setProps
The gl prop must be set when constructing Deck, not via setProps after
construction. Move gl retrieval and WebGL1 compatibility warning back to
mapbox-overlay.ts where the Deck is constructed, and remove redundant gl
handling from getDeckInstance.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* refactor(mapbox): Remove redundant parameters merge in getDeckInstance
Parameters are already merged when creating Deck in mapbox-overlay.ts,
so the merge in getDeckInstance is redundant.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* refactor(mapbox): Remove unused deck prop from MapboxLayerProps
The deck prop was vestigial from the old code where it was passed to
getDeckInstance. Now MapboxLayer accesses the deck via map.__deck,
so the prop is no longer needed.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* chore(mapbox): Remove unsupported mapbox-layers-react test app
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix(mapbox): Remove deck prop from MapboxLayer in resolve-layers
Missed this usage when removing the deck prop from MapboxLayerProps.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* chore(mapbox): Remove unsupported mapbox-layers test apps
Remove mapbox-layers test app directory and update index.html links.
The mapbox-layers-react app was already deleted in a previous commit.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* docs(mapbox): Update MapboxLayer doc to reflect internal-only status
MapboxLayer is no longer part of the public API. Updated the doc to
add a deprecation notice and migration guide pointing to MapboxOverlay.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* docs(mapbox): Remove MapboxLayer doc and update references
MapboxLayer is internal-only and should not be documented as a public
API. Removed the doc file and updated references in whats-new.md and
test README.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix(mapbox): Update tests to create Deck with default parameters
Tests now create Deck with default parameters merged, matching how
MapboxOverlay._onAddInterleaved creates the Deck. This is needed
because getDeckInstance no longer merges default parameters.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* refactor(mapbox): Remove mapboxLayers tracking from UserData
Instead of tracking MapboxLayer instances in a Set, use map.getLayer()
to check if a deck layer has a corresponding MapboxLayer on the map.
This simplifies the code since resolve-layers already creates MapboxLayer
instances with the same ID as the deck layer.
Ref: #9944
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* refactor(mapbox): Add null guard and consistent signature to MapboxLayer
- Add gl parameter to onAdd for consistency with CustomLayerInterface
- Add null guard in render() for safety, matching MapboxLayerGroup
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>MapboxLayer (#9955)1 parent 50df2f2 commit 914c3d2
File tree
15 files changed
+82
-473
lines changed- docs
- api-reference/mapbox
- modules/mapbox/src
- test
- apps/mapbox-integration
- mapbox-layers-react
- mapbox-layers
- modules/mapbox
15 files changed
+82
-473
lines changedThis file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
850 | 850 | | |
851 | 851 | | |
852 | 852 | | |
853 | | - | |
| 853 | + | |
854 | 854 | | |
855 | 855 | | |
856 | 856 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | 17 | | |
19 | | - | |
20 | | - | |
21 | 18 | | |
22 | 19 | | |
23 | 20 | | |
| |||
27 | 24 | | |
28 | 25 | | |
29 | 26 | | |
30 | | - | |
31 | 27 | | |
32 | 28 | | |
33 | 29 | | |
34 | | - | |
35 | | - | |
| 30 | + | |
36 | 31 | | |
37 | 32 | | |
38 | 33 | | |
39 | 34 | | |
40 | 35 | | |
41 | 36 | | |
42 | 37 | | |
43 | | - | |
44 | | - | |
| 38 | + | |
| 39 | + | |
45 | 40 | | |
46 | 41 | | |
47 | | - | |
| 42 | + | |
48 | 43 | | |
49 | 44 | | |
50 | 45 | | |
| |||
54 | 49 | | |
55 | 50 | | |
56 | 51 | | |
57 | | - | |
58 | 52 | | |
59 | 53 | | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
75 | 67 | | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
| 68 | + | |
82 | 69 | | |
83 | 70 | | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
| 71 | + | |
94 | 72 | | |
95 | | - | |
96 | | - | |
97 | | - | |
| 73 | + | |
98 | 74 | | |
99 | | - | |
| 75 | + | |
100 | 76 | | |
101 | 77 | | |
102 | | - | |
| 78 | + | |
103 | 79 | | |
104 | 80 | | |
105 | 81 | | |
| |||
141 | 117 | | |
142 | 118 | | |
143 | 119 | | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | 120 | | |
159 | 121 | | |
160 | 122 | | |
| |||
371 | 333 | | |
372 | 334 | | |
373 | 335 | | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
395 | 347 | | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
396 | 356 | | |
397 | 357 | | |
398 | 358 | | |
| |||
408 | 368 | | |
409 | 369 | | |
410 | 370 | | |
411 | | - | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | | - | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
| |||
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
24 | | - | |
25 | | - | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
37 | | - | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | | - | |
45 | 44 | | |
46 | 45 | | |
47 | 46 | | |
48 | | - | |
| 47 | + | |
49 | 48 | | |
50 | | - | |
| 49 | + | |
51 | 50 | | |
52 | 51 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
12 | | - | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
23 | | - | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
39 | 38 | | |
40 | 39 | | |
41 | 40 | | |
42 | 41 | | |
43 | 42 | | |
44 | | - | |
| 43 | + | |
45 | 44 | | |
46 | | - | |
47 | | - | |
48 | 45 | | |
49 | 46 | | |
50 | 47 | | |
51 | | - | |
52 | | - | |
53 | | - | |
| 48 | + | |
54 | 49 | | |
55 | 50 | | |
56 | 51 | | |
57 | 52 | | |
58 | 53 | | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | 54 | | |
64 | 55 | | |
65 | 56 | | |
66 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
67 | 60 | | |
68 | 61 | | |
0 commit comments