GeoSnap is a web application built with Next.js, TypeScript, and React Leaflet that allows users to create, edit, and manage polygons on an interactive map. The application provides advanced features for polygon manipulation, data management, and geolocation support.
- Interactive map with drawing tools
- Polygon creation and management
- Color customization for polygons
- Area calculation and center markers
- Polygon validation (no overlapping)
- Import/Export polygon data
- Geolocation support
- Search and filter polygons
- Responsive design
- Next.js 14
- TypeScript
- Redux Toolkit
- React Leaflet
- Sass/SCSS
- Turf.js for geospatial calculations
- Node.js (v18 or higher)
- npm or yarn
-
Clone the repository:
git clone https://github.com/programmerbanna/geosnap.git cd geosnap
-
Install dependencies:
npm install # or yarn install
-
Run the development server:
npm run dev # or yarn dev
-
Open http://localhost:3000 in your browser.
-
Create a production build:
npm run build # or yarn build
-
Start the production server:
npm start # or yarn start
- Zoom Controls:
- Click (+) to zoom in
- Click (-) to zoom out
- Click (⌖) to center map on your location
- Use mouse wheel for smooth zooming
-
Start Drawing:
- Click the pencil icon (✎) to enter drawing mode
- Icon turns red (✕) when drawing mode is active
-
Create Polygon:
- Single click to place points on the map
- Points are connected automatically
- Minimum 3 points required
- Double click to complete the polygon
- Preview shows real-time shape
-
Customize Colors:
- Use color pickers while drawing to set:
- Fill color
- Border color
- Colors can be changed later from the sidebar
- Use color pickers while drawing to set:
-
View Polygons:
- All polygons listed in sidebar
- Shows area and unique ID
- Hover over center marker for area details
-
Search Polygons:
- Use search bar in sidebar
- Filter by polygon ID or label
- Results update in real-time
-
Edit Polygons:
- Change fill/border colors
- Delete using the trash icon
- Changes reflect immediately on map
-
Export Data:
- Click "Export" in sidebar
- Saves as JSON file
- Includes all polygon data:
- Coordinates
- Colors
- Labels
- Areas
-
Import Data:
- Click "Import" in sidebar
- Select JSON file
- Validates polygon data
- Shows error if validation fails
- Map auto-centers on imported polygons
- Polygons cannot overlap
- Minimum 3 points required
- Points cannot be inside existing polygons
- Error messages show if validation fails
- ESC: Cancel current drawing
- Delete: Remove selected polygon
- Space: Toggle sidebar
- Ctrl/Cmd + Z: Undo last point while drawing
- Use the center button (⌖) to find your location
- Double-click completes the current polygon
- Export regularly to save your work
- Search works with partial matches
I welcome contributions to this project! Here's how you can help:
-
Fork the repository
-
Clone your fork:
git clone https://github.com/programmerbanna/geosnap.git cd geosnap
-
Create a new branch:
git checkout -b feature/your-feature-name
-
Install dependencies:
npm install # or yarn install
- Follow the existing code style and TypeScript conventions
- Ensure all components are properly typed
- Write meaningful commit messages
- Add comments for complex logic
- Update documentation when adding new features
- Make your changes
- Test your changes thoroughly
- Ensure no TypeScript errors or ESLint warnings
- Update relevant documentation
- Add tests if applicable
-
Push to your fork:
git push origin feature/your-feature-name
-
Create a Pull Request from your fork to our main repository
-
Describe your changes in detail:
- What problem does it solve?
- What changes have you made?
- Any breaking changes?
- Screenshots (if applicable)
- Use TypeScript for all new files
- Follow the existing SCSS module pattern
- Use functional components with hooks
- Maintain component hierarchy:
- atoms/ (basic components)
- molecules/ (combinations of atoms)
- organisms/ (complex components)
- templates/ (page layouts)
- Check existing issues and pull requests
- Create an issue for discussion
- Join our community discussions
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
MIT License
Copyright (c) 2025 Hasanul Haque Banna
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.