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
Learn more with in our [Getting Started](https://visgl.github.io/react-map-gl/docs/get-started) guide.
78
81
79
-
### Using Mapbox Tokens
80
-
81
-
**Starting with v2.0, mapbox-gl requires a Mapbox token for any usage, with or without the Mapbox data service. See [about Mapbox tokens](/docs/get-started/mapbox-tokens.md) for your options.**
82
-
83
-
To show maps from a service such as Mapbox you will need to register on their website in order to retrieve an access token required by the map component, which will be used to identify you and start serving up map tiles. The service will be free until a certain level of traffic is exceeded.
84
-
85
-
There are several ways to provide a token to your app, as showcased in some of the example folders:
86
-
87
-
* Provide a `mapboxAccessToken` prop to the map component
88
-
* Set the `MapboxAccessToken` environment variable (or set `REACT_APP_MAPBOX_ACCESS_TOKEN` if you are using Create React App)
89
-
* Provide it in the URL, e.g `?access_token=TOKEN`
react-map-gl is a suite of [React](http://facebook.github.io/react/) components for
19
5
[mapbox-gl](https://github.com/mapbox/mapbox-gl-js), [maplibre-gl](https://maplibre.org/maplibre-gl-js/docs/) or compatible libraries.
20
6
@@ -44,10 +30,10 @@ This does not scale when we have many components that need to synchronize with e
44
30
45
31
Ultimately, in the spirit of the [reactive programming paradigm](https://en.wikipedia.org/wiki/Reactive_programming), data always flows **down**. As long as the map manages its own state, as mapbox-gl is designed to do, we risk the components going out of sync.
46
32
47
-
react-map-gl creates a fully reactive wrapper for mapbox-gl. The [Map](./api-reference/map.md) component can be fully [controlled](https://reactjs.org/docs/forms.html#controlled-components), that is, the map's camera would never deviate from the props that it's assigned. Read more about this core behavior in [state management](./get-started/state-management.md).
33
+
react-map-gl creates a fully reactive wrapper for mapbox-gl/maplibre-gl. The [Map](./api-reference/maplibre/map.md) component can be fully [controlled](https://reactjs.org/docs/forms.html#controlled-components), that is, the map's camera would never deviate from the props that it's assigned. Read more about this core behavior in [state management](./get-started/state-management.md).
48
34
49
35
## Limitations
50
36
51
37
In v7.0, react-map-gl was fully rewritten to better align its API with the underlying Mapbox GL JS library. Wherever the reactive usage patterns permits, the wrapper's props and methods are 1:1 mappings to their native API equivelants.
52
38
53
-
It is possible to call the native methods directly from the `Map` instance obtained via [getMap](./api-reference/map.md#gemap). However, doing so may result in the map's state to deviate from its props. For example, calling `map.setMaxZoom` directly will cause the map's constraint settings to differ from the value of the `maxZoom` prop. Generally speaking, calling a native method is disencouraged if the same thing can be achieved through the React interface. If a third-party plugin does so, then it may lead to some unexpected behaviors.
39
+
It is possible to call the native methods directly from the `Map` instance obtained via [getMap](./api-reference/maplibre/map.md#gemap). However, doing so may result in the map's state to deviate from its props. For example, calling `map.setMaxZoom` directly will cause the map's constraint settings to differ from the value of the `maxZoom` prop. Generally speaking, calling a native method is disencouraged if the same thing can be achieved through the React interface. If a third-party plugin does so, then it may lead to some unexpected behaviors.
Copy file name to clipboardExpand all lines: docs/api-reference/mapbox/attribution-control.md
+5-37Lines changed: 5 additions & 37 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,11 @@
1
1
# AttributionControl
2
2
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/classes/AttributionControl/)).
4
-
5
-
6
-
import Tabs from '@theme/Tabs';
7
-
import TabItem from '@theme/TabItem';
8
-
9
-
<TabsgroupId="map-library">
10
-
<TabItemvalue="mapbox"label="Mapbox">
3
+
React component that wraps mapbox-gl's [AttributionControl](https://docs.mapbox.com/mapbox-gl-js/api/markers/#attributioncontrol) class.
Copy file name to clipboardExpand all lines: docs/api-reference/mapbox/fullscreen-control.md
+3-32Lines changed: 3 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,11 @@
1
1
# FullscreenControl
2
2
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/classes/FullscreenControl/)).
4
-
5
-
6
-
import Tabs from '@theme/Tabs';
7
-
import TabItem from '@theme/TabItem';
8
-
9
-
<TabsgroupId="map-library">
10
-
<TabItemvalue="mapbox"label="Mapbox">
3
+
React component that wraps mapbox-gl's [FullscreenControl](https://docs.mapbox.com/mapbox-gl-js/api/markers/#fullscreencontrol) class.
Copy file name to clipboardExpand all lines: docs/api-reference/mapbox/geolocate-control.md
+11-72Lines changed: 11 additions & 72 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,11 @@
1
1
# GeolocateControl
2
2
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/classes/GeolocateControl/)).
4
-
5
-
6
-
import Tabs from '@theme/Tabs';
7
-
import TabItem from '@theme/TabItem';
8
-
9
-
<TabsgroupId="map-library">
10
-
<TabItemvalue="mapbox"label="Mapbox">
3
+
React component that wraps mapbox-gl's [GeolocateControl](https://docs.mapbox.com/mapbox-gl-js/api/markers/#geolocatecontrol) class.
0 commit comments