Closed davidascher closed 7 years ago
Found the answer in the API doc:
To use the original Mapbox API use onStyleLoad property, the callback function will receive the map object as a first arguments, then you can add your own logic using mapbox gl API.
Happy to see that the documentation is explicit enough 👍
It should be helpful to write example :)
I'm trying to add the Geolocate control (https://www.mapbox.com/mapbox-gl-js/api/#GeolocateControl) to my map, but I'm struggling to figure how. The React devtools tell me that
ReactMapboxGL
's state contains themap
object, but it seems improper to poke into the state of a child component from a container component.What's the best way to use mapbox-gl APIs that aren't encapsulated by the reactified wrapper?