This is a professional web-based mapping application that allows users to visualize locations, find their current position, search for places, and calculate distances between points. The application provides both straight-line distance calculations and actual road distance routing with estimated travel times.
- Powered by Leaflet.js and OpenStreetMap
- Responsive, full-screen map display
- Custom markers with informative popups
- "Locate Me" functionality to find and display the user's current location
- Accuracy radius visualization
- Error handling for location services
- Search for any location worldwide using the Nominatim geocoding API
- Display search results with markers and descriptive popups
- Center map on search results
- Calculate distances between two points:
- User's current location
- Search result location
- Custom points selected on the map
- Dual distance measurement:
- Straight-line (as-the-crow-flies) distance
- Actual road distance using OSRM routing API
- Visual representation of both straight-line path and actual road route
- Estimated driving time calculation
- Distance displayed in both kilometers and miles
- Turn-by-turn directions with real-time position tracking
- Visual route guidance with highlighted paths
- Voice guidance for navigation instructions
- Real-time ETA updates based on current speed
- Directions panel showing current and next instructions
- Option to toggle voice guidance on/off
- Clean, intuitive Bootstrap-based interface
- Mobile-responsive design
- Clear visual feedback for all operations
- Frontend: HTML5, CSS3, JavaScript
- Map Library: Leaflet.js
- UI Framework: Bootstrap 5
- APIs:
- OpenStreetMap for base map tiles
- Nominatim for geocoding (location search)
- OSRM (Open Source Routing Machine) for road distance calculations
- Git installed on your computer (download from git-scm.com)
- A modern web browser (Chrome, Firefox, Edge, Safari)
- Optional: A local web server (like http-server, Live Server, or similar)
-
Open your terminal or command prompt
-
Navigate to the directory where you want to store the project
-
Run the following command to clone the repository:
git clone https://github.com/MohitSutharOfficial/findyourmap.git
-
Navigate into the project directory:
cd findyourmap
- Simply open the
index.html
file in your web browser - Note: Some features may not work properly due to browser security restrictions when opening files directly
-
Install a simple HTTP server if you don't have one:
- Using Node.js:
npm install -g http-server
- Using Python: Python comes with a built-in HTTP server
- Using VS Code: Install the "Live Server" extension
- Using Node.js:
-
Start the server:
- Node.js: Run
http-server
in the project directory - Python 3.x: Run
python -m http.server 8000
in the project directory - VS Code: Right-click on
index.html
and select "Open with Live Server"
- Node.js: Run
-
Open your browser and navigate to:
- http-server:
http://localhost:8080
- Python server:
http://localhost:8000
- VS Code Live Server: It will open automatically in your default browser
- http-server:
- Pan the map by clicking and dragging
- Zoom in/out using the mouse wheel or the zoom controls
- Click the "Locate Me" button to center the map on your current location
- Your position will be marked with a blue marker and accuracy circle
- Enter a place name, address, or coordinates in the search box
- Press Enter or click the "Search" button
- The map will center on the found location with a marker
- Select Point A from the dropdown (My Location, Search Result, or Custom Point)
- If "Custom Point" is selected, click anywhere on the map to set the point
- Select Point B using the same method
- Click "Calculate Distance" to see:
- Straight-line distance (shown as a dotted blue line)
- Road distance (shown as a solid green line)
- Estimated driving time
- First, click the "Locate Me" button to find your current position
- Select a destination using one of these methods:
- Search for a location and use the search result
- Select a custom point on the map
- Click the "Start Navigation" button to begin turn-by-turn navigation
- During navigation:
- Follow the highlighted route on the map
- View current and next instructions in the directions panel
- Listen to voice guidance for upcoming turns
- Monitor your ETA and remaining distance
- Use the "Mute Voice" button to toggle voice guidance on/off
- Click "Stop Navigation" when you've reached your destination or want to end navigation
- Click the "Reset Map" button to clear all markers and return to the default view
- Leaflet.js 1.9.4
- Bootstrap 5.3.0
- The application uses free, public APIs which may have usage limitations
- Internet connection is required for map tiles, geocoding, and routing functionality
- Location services require user permission in the browser