Skip to content

gsrntvc2102000/location-tracker-and-Emergency-Information-Web-Page-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Certainly! Below is the information formatted for a GitHub README file.


Location Tracker and Emergency Information Web Page

Part 1: Location Tracker with Google Maps API

Introduction

The "Location Tracker with Google Maps" project is a web application that utilizes the Google Maps JavaScript API to display the user's current location along with its corresponding address. The project provides a button to fetch the user's location and retrieve the address through reverse geocoding.

Project Components

HTML File (index.html)

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Location Tracker</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            text-align: center;
            margin: 50px;
        }
    </style>
</head>
<body>
    <h1>Location Tracker</h1>
    <button onclick="getLocation()">Get My Location</button>
    <p id="location"></p>
    <p id="address"></p>

    <script>
        // JavaScript code for location tracking
        // (Include the complete JavaScript code here)
    </script>
</body>
</html>

JavaScript Module (index.js)

// JavaScript code for location tracking
// (Include the complete JavaScript code here)

Google Maps API Integration

The project utilizes the Google Maps JavaScript API to display the map and perform reverse geocoding to retrieve the address based on latitude and longitude.

Google Maps API Key

Ensure a valid Google Maps API key is obtained and used in the API request for proper authentication.

Geolocation and Reverse Geocoding

The navigator.geolocation API is used to fetch the user's current location. The obtained coordinates are then used to make a request to the Google Maps Geocoding API to retrieve the address information.

Execution

When the "Get My Location" button is clicked, the JavaScript code triggers the geolocation API to fetch the user's coordinates. These coordinates are then used to perform reverse geocoding and obtain the corresponding address, which is displayed on the webpage.

Troubleshooting

If issues arise, check the browser's developer console for any error messages. Common troubleshooting steps include verifying the API key, ensuring proper API key permissions, and checking for any errors in the JavaScript code.

Future Enhancements

Possible future enhancements to the project include:

  • Improved styling and user interface.
  • Integration with additional mapping services.
  • Geolocation tracking with real-time updates.
  • User authentication for personalized experiences.

Conclusion

The "Location Tracker with Google Maps API" project provides a basic yet functional demonstration of geolocation and reverse geocoding using the Google Maps JavaScript API. It serves as a foundation for building more sophisticated location-based applications.


Part 2: Emergency Information Web Page

Project Overview

The Emergency Information Web Page is designed to provide essential information during emergencies, including contact details, evacuation routes, weather alerts, and access to national emergency and safety manuals. The web page is equipped with the Web Share API, allowing users to easily share important information.

Features

  1. Emergency Contacts:

    • Local Police: 100
    • Fire Department: 101
    • Ambulance: 102
    • National Emergency Helpline: 112
  2. Evacuation Routes:

    • Know the designated evacuation routes in your area.
  3. National Emergency and Safety Manuals:

  4. Weather Alerts:

    • Subscribe to weather alert services and have a weather radio.
    • Get location-specific weather alerts using the OpenWeatherMap API.
  5. Share Functionality:

    • The web page is integrated with the Web Share API.
    • Users can easily share emergency information with others.

Implementation Details

Emergency Contacts

<section>
    <h2>Emergency Contacts</h2>
    <p>Local Police: 100</p>
    <p>Fire Department: 101</p>
    <p>Ambulance: 102</p>
    <p>National Emergency Helpline: 112</p>
</section>

Evacuation Routes

<section>
    <h2>Evacuation Routes</h2>
    <p>Know the designated evacuation routes in your area.</p>
</section>

National Emergency and Safety Manuals

<section>
    <h2>National Emergency and Safety Manuals</h2>
    <p>Access national emergency and safety manuals to ensure preparedness and safety. Download the following documents:</p>
    <ul>
        <li><a href="path/to/national

-emergency-guide.pdf" target="_blank">National Emergency Guide</a></li>
        <li><a href="path/to/safety-manual.pdf" target="_blank">Safety Manual</a></li>
    </ul>
</section>

Weather Alerts

<section>
    <h2>Weather Alerts</h2>
    <div class="weather-info-container">
        <div class="column" id="temperature-info">
            <!-- Temperature information will be displayed here -->
        </div>
        <div class="column" id="additional-info">
            <!-- Additional weather information will be displayed here -->
        </div>
    </div>
    <!-- Web Share API integration script is included in the code -->
</section>

Web Share API Integration

<script>
    if (navigator.share) {
        const shareButton = document.getElementById('shareButton');
        shareButton.addEventListener('click', () => {
            navigator.share({
                title: 'Emergency Information',
                text: 'Stay informed with this emergency information web page.',
                url: window.location.href
            })
            .then(() => console.log('Shared successfully'))
            .catch((error) => console.error('Error sharing:', error));
        });
    } else {
        console.log('Web Share API is not supported in this browser.');
    }
</script>

Conclusion

The Emergency Information Web Page provides a user-friendly platform for accessing critical information during emergencies. The integration of the Web Share API enhances the page's usability, allowing users to share important details with others seamlessly.


Feel free to replace placeholder paths and customize the content further based on your project's specifics.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages