This example aims to show a basic example on how to integrate the map library "leaflet" along with some basic functionality like markers.
Additionally, since we will be using React, we will add a second library called "react-leaflet", which simply wraps "leaflet" extending its functionality to expose it as React components.
These libraries are "unrelated"in the sense that are develop by different people
There is a third dependency that we will be using for Typescript support: "@types/leaflet"
A couple of notes I want to mention regarding these libraries:
import 'leaflet/dist/leaflet.css';
The examples are all wrapped under components. They can be found under /src/examples
This component contains examples on how to use the markers and a few map tiles.
This component contains examples on how to draw lines between markers to simulate a path.
This component contains examples on how to use custom icons in your markers.
Run the development web server at localhost:5173
:
npm run dev
You can build the web app with:
npm run build