MapCraft is an interactive map application that allows users to draw markers, lines, and polygons on a map, determine their location, and download them as a GeoJSON file.
- Vite — A fast frontend build tool
- Vanilla JavaScript (ESM) — Organized with modules
- Mapbox GL JS — Interactive map library
- Lucide Icons — UI icons
- Tailwind CSS — For minimal and modern styling
- 🧭 Interactive Map — A modern, smooth map interface powered by Mapbox GL.
- 📍 Add Markers — Place markers at desired locations on the map and view their coordinates.
- 📏 Draw Lines — Draw paths or connections between any points.
- 🟦 Create Polygons — Define area or region boundaries.
- 📡 Find Location — Detect and display the user's current location on the map.
- 💾 Download GeoJSON — Save all drawn markers, lines, and polygons as a
.geojsonfile. - 🧩 Modular System — A clean, reusable code architecture with
utils/andmodules/structures. - 🔧 Extendable Design — Easily add new modules (like the Help modal).
/
├── public/
│ └── favicon.svg
├── src/
│ ├── modules/
│ │ ├── download.js # Download functionality
│ │ └── help.js # Help modal module
│ ├── ui/
│ │ └── style.css # Main styles
│ ├── utils/
│ │ └── geojson.js # GeoJSON creation logic
│ └── main.js # Application entry point
├── .gitignore
├── index.html
├── package.json
├── vite.config.ts
└── README.md
-
Clone the repository:
git clone https://github.com/firdavsdev07/MapCraft.git
-
Navigate to the directory:
cd MapCraft -
Install dependencies (using
pnpmornpm):# using pnpm pnpm install # or using npm npm install
-
Create a
.envfile: In the project root, create a file named.envand add your Mapbox access token:VITE_API_TOKEN=YOUR_MAPBOX_ACCESS_TOKEN
Replace
YOUR_MAPBOX_ACCESS_TOKENwith your actual token from Mapbox. -
Run the project:
# using pnpm pnpm dev # or using npm npm run dev
The application will open at http://localhost:5173.
