File tree 3 files changed +44
-3
lines changed
3 files changed +44
-3
lines changed Original file line number Diff line number Diff line change @@ -167,6 +167,44 @@ def __init__(
167
167
[`lonboard.basemap.CartoBasemap.PositronNoLabels`][lonboard.basemap.CartoBasemap.PositronNoLabels]
168
168
"""
169
169
170
+ custom_attribution = traitlets .Union (
171
+ [
172
+ traitlets .Unicode (allow_none = True ),
173
+ traitlets .List (traitlets .Unicode (allow_none = False )),
174
+ ]
175
+ ).tag (sync = True )
176
+ """
177
+ Custom attribution to display on the map.
178
+
179
+ This attribute supports the same format as the `attribution` property in the
180
+ Maplibre API.
181
+
182
+ - Type: `str` or `List[str]`
183
+ - Default: `None`
184
+
185
+ You can provide either a single string or a list of strings for custom attributions.
186
+ If an attribution value is set in the map style, it will be displayed in addition to
187
+ this custom attribution.
188
+
189
+ **Example:**
190
+
191
+ ```py
192
+ m = Map(
193
+ layers,
194
+ custom_attribution="Development Seed"
195
+ )
196
+ ```
197
+
198
+ **Example:**
199
+
200
+ ```py
201
+ m = Map(
202
+ layers,
203
+ custom_attribution=["Development Seed", "OpenStreetMap"]
204
+ )
205
+ ```
206
+ """
207
+
170
208
# TODO: We'd prefer a "Strict union of bool and float" but that doesn't
171
209
# work here because `Union[bool, float]` would coerce `1` to `True`, which we don't
172
210
# want, and `Union[float, bool]` would coerce `True` to `1`, which we also don't
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import { v4 as uuidv4 } from "uuid";
14
14
import { Message } from "./types.js" ;
15
15
import { flyTo } from "./actions/fly-to.js" ;
16
16
import { useViewStateDebounced } from "./state" ;
17
+ import "maplibre-gl/dist/maplibre-gl.css" ;
17
18
18
19
await initParquetWasm ( ) ;
19
20
@@ -71,6 +72,7 @@ function App() {
71
72
let [ pickingRadius ] = useModelState < number > ( "picking_radius" ) ;
72
73
let [ useDevicePixels ] = useModelState < number | boolean > ( "use_device_pixels" ) ;
73
74
let [ parameters ] = useModelState < object > ( "parameters" ) ;
75
+ let [ customAttribution ] = useModelState < string > ( "custom_attribution" ) ;
74
76
75
77
// initialViewState is the value of view_state on the Python side. This is
76
78
// called `initial` here because it gets passed in to deck's
@@ -184,7 +186,10 @@ function App() {
184
186
} }
185
187
parameters = { parameters || { } }
186
188
>
187
- < Map mapStyle = { mapStyle || DEFAULT_MAP_STYLE } />
189
+ < Map
190
+ mapStyle = { mapStyle || DEFAULT_MAP_STYLE }
191
+ customAttribution = { customAttribution }
192
+ > </ Map >
188
193
</ DeckGL >
189
194
</ div >
190
195
) ;
Original file line number Diff line number Diff line change @@ -62,8 +62,6 @@ export abstract class BaseLayerModel extends BaseModel {
62
62
}
63
63
64
64
baseLayerProps ( ) : LayerProps {
65
- // console.log("extensions", this.extensionInstances());
66
- // console.log("extensionprops", this.extensionProps());
67
65
return {
68
66
extensions : this . extensionInstances ( ) ,
69
67
...this . extensionProps ( ) ,
You can’t perform that action at this time.
0 commit comments