This multi-part React tutorial will be covering how to use Mapbox to:
and even removing a marker.
We will be using create-react-app for our base React app and using the react-map-gl and react-mapbox-gl-geocoder libraries for our map and geocoder respectively. As an option, I will be using reactstrap for styling (in case you are unfamiliar, reactstrap is Bootstrap for React).
First, we will start by setting up our project.
npx create-react-app mapbox-project
cd mapbox-project
npm i react-map-gl react-mapbox-gl-geocoder bootstrap reactstrap
npm start
In order to use Mapbox, you will need an API key. Go to https://www.mapbox.com/ and click on Sign In.
Under the signin form, click on Sign Up for Mapbox. Once you are done signing up, you should be taken to your dashboard. If you weren’t automatically given a token, you can create one by clicking Create a token.
#react #programming #tutorial #mapping #mapbox