You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/api-reference/attribution-control.md
+48-17Lines changed: 48 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -1,55 +1,86 @@
1
1
# AttributionControl
2
2
3
-
React component that wraps [AttributionControl](https://docs.mapbox.com/mapbox-gl-js/api/markers/#attributioncontrol).
3
+
React component that wraps the base library's `AttributionControl` class ([Mapbox](https://docs.mapbox.com/mapbox-gl-js/api/markers/#attributioncontrol) | [Maplibre](https://maplibre.org/maplibre-gl-js-docs/api/markers/#attributioncontrol)).
<AttributionControlcustomAttribution="Map design by me" />
24
52
</Map>;
25
53
}
26
54
```
27
55
56
+
</TabItem>
57
+
</Tabs>
58
+
28
59
## Properties
29
60
30
-
Note that the following properties are not reactive. They are only used when the component first mounts.
61
+
### Reactive Properties
31
62
32
-
#### `compact`: boolean | undefined {#compact}
63
+
#### `style`: CSSProperties {#style}
64
+
65
+
CSS style override that applies to the control's container.
66
+
67
+
### Other Properties
33
68
34
-
- If `true` , force a compact attribution that shows the full attribution on mouse hover.
35
-
- If `false` , force the full attribution control.
36
-
- If unset, shows a responsive attribution that collapses when the map is less than 640 pixels wide.
69
+
The properties in this section are not reactive. They are only used when the component first mounts.
37
70
38
-
Note that your attribution must adhere to Mapbox's [guidelines](https://docs.mapbox.com/help/getting-started/attribution/).
71
+
Any options supported by the `AttributionControl` class ([Mapbox](https://docs.mapbox.com/mapbox-gl-js/api/markers/#attributioncontrol) | [Maplibre](https://maplibre.org/maplibre-gl-js-docs/api/markers/#attributioncontrol)), such as
Copy file name to clipboardExpand all lines: docs/api-reference/fullscreen-control.md
+44-7Lines changed: 44 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,21 @@
1
1
# FullscreenControl
2
2
3
-
React component that wraps [FullscreenControl](https://docs.mapbox.com/mapbox-gl-js/api/markers/#fullscreencontrol).
3
+
React component that wraps the base library's `FullscreenControl` class ([Mapbox](https://docs.mapbox.com/mapbox-gl-js/api/markers/#fullscreencontrol) | [Maplibre](https://maplibre.org/maplibre-gl-js-docs/api/markers/#fullscreencontrol)).
React component that wraps [GeolocateControl](https://docs.mapbox.com/mapbox-gl-js/api/markers/#geolocateControl).
3
+
React component that wraps the base library's `GeolocateControl` class ([Mapbox](https://docs.mapbox.com/mapbox-gl-js/api/markers/#geolocatecontrol) | [Maplibre](https://maplibre.org/maplibre-gl-js-docs/api/markers/#geolocatecontrol)).
4
4
5
-
```js
5
+
6
+
import Tabs from '@theme/Tabs';
7
+
import TabItem from '@theme/TabItem';
8
+
9
+
<TabsgroupId="map-library">
10
+
<TabItemvalue="mapbox"label="Mapbox">
11
+
12
+
```tsx
6
13
import*asReactfrom'react';
7
14
importMap, {GeolocateControl} from'react-map-gl';
8
15
9
16
function App() {
10
17
return <Map
11
-
mapLib={import('mapbox-gl')}
18
+
mapboxAccessToken="<Mapbox access token>"
12
19
initialViewState={{
13
20
longitude: -100,
14
21
latitude: 40,
@@ -21,87 +28,95 @@ function App() {
21
28
}
22
29
```
23
30
24
-
## Methods
25
-
26
-
Imperative methods are accessible via a [React ref](https://reactjs.org/docs/refs-and-the-dom.html#creating-refs) hook:
A ([fitBounds](https://docs.mapbox.com/mapbox-gl-js/api/map/#map#fitbounds)) options object to use when the map is panned and zoomed to the user's location.
Draw a transparent circle will be drawn around the user location indicating the accuracy (95% confidence level) of the user's location. Set to `false` to disable.
90
-
This only has effect if `showUserLocation` is `true`.
@@ -125,6 +140,27 @@ Called when the GeolocateControl changes to the active lock state.
125
140
Called when the GeolocateControl changes to the background state.
126
141
127
142
143
+
### Other Properties
144
+
145
+
The properties in this section are not reactive. They are only used when the component first mounts.
146
+
147
+
Any options supported by the `GeolocateControl` class ([Mapbox](https://docs.mapbox.com/mapbox-gl-js/api/markers/#geolocatecontrol) | [Maplibre](https://maplibre.org/maplibre-gl-js-docs/api/markers/#geolocatecontrol)), such as
0 commit comments