{"id":448,"date":"2026-08-21T11:55:46","date_gmt":"2026-08-21T06:25:46","guid":{"rendered":"https:\/\/vipashafarms.in\/?page_id=448"},"modified":"2026-08-31T22:12:15","modified_gmt":"2026-08-31T16:42:15","slug":"scan-new-field","status":"publish","type":"page","link":"https:\/\/vipashafarms.in\/pa\/scan-new-field\/","title":{"rendered":"\u0a28\u0a35\u0a3e\u0a02 \u0a16\u0a47\u0a24 \u0a38\u0a15\u0a48\u0a28 \u0a15\u0a30\u0a4b"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"448\" class=\"elementor elementor-448\">\n\t\t\t\t<div class=\"elementor-element elementor-element-c3c62c8 e-flex e-con-boxed e-con e-parent\" data-id=\"c3c62c8\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-cd72095 elementor-widget elementor-widget-heading\" data-id=\"cd72095\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Capture your field location, boundary and crop details.<\/h2>\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-024ac96 e-flex e-con-boxed e-con e-parent\" data-id=\"024ac96\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-e4b6564 elementor-widget elementor-widget-html\" data-id=\"e4b6564\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t\t<div id=\"vf-gps-box\">\r\n\r\n    <button type=\"button\"\r\n            id=\"vf-gps-button\"\r\n            class=\"vf-gps-button\">\r\n        \ud83d\udccd Get Current Location\r\n    <\/button>\r\n\r\n    <div id=\"vf-gps-result\" class=\"vf-gps-result\"><\/div>\r\n\r\n<\/div>\r\n\r\n\r\n<script>\r\n\r\ndocument.addEventListener('DOMContentLoaded', function () {\r\n\r\n    const button =\r\n        document.getElementById('vf-gps-button');\r\n\r\n    const result =\r\n        document.getElementById('vf-gps-result');\r\n\r\n    if (!button || !result) return;\r\n\r\n\r\n    button.addEventListener('click', function () {\r\n\r\n\r\n        \/* Check GPS support *\/\r\n\r\n        if (!navigator.geolocation) {\r\n\r\n            result.innerHTML =\r\n                '\u274c GPS is not supported on this device.';\r\n\r\n            return;\r\n        }\r\n\r\n\r\n        \/* Button state *\/\r\n\r\n        button.innerText =\r\n            '\ud83d\udce1 Getting accurate location...';\r\n\r\n        button.disabled = true;\r\n\r\n\r\n        result.innerHTML =\r\n            'Please wait for GPS signal...';\r\n\r\n\r\n        navigator.geolocation.getCurrentPosition(\r\n\r\n\r\n            function (position) {\r\n\r\n\r\n                const latitude =\r\n                    position.coords.latitude;\r\n\r\n                const longitude =\r\n                    position.coords.longitude;\r\n\r\n                const accuracy =\r\n                    position.coords.accuracy;\r\n\r\n\r\n                \/* Save coordinates *\/\r\n\r\n                sessionStorage.setItem(\r\n                    'vf_field_latitude',\r\n                    latitude\r\n                );\r\n\r\n                sessionStorage.setItem(\r\n                    'vf_field_longitude',\r\n                    longitude\r\n                );\r\n\r\n                sessionStorage.setItem(\r\n                    'vf_gps_accuracy',\r\n                    accuracy\r\n                );\r\n\r\n\r\n                \/* Show coordinates *\/\r\n\r\n                result.innerHTML =\r\n\r\n                    '<strong>\u2713 Location Captured<\/strong><br><br>' +\r\n\r\n                    'Latitude: ' +\r\n                    latitude.toFixed(6) +\r\n                    '<br>' +\r\n\r\n                    'Longitude: ' +\r\n                    longitude.toFixed(6) +\r\n                    '<br>' +\r\n\r\n                    'GPS Accuracy: \u00b1' +\r\n                    Math.round(accuracy) +\r\n                    ' meters';\r\n\r\n\r\n                \/* Accuracy warning *\/\r\n\r\n                if (accuracy <= 10) {\r\n\r\n                    result.innerHTML +=\r\n                        '<br><br>\ud83d\udfe2 GPS accuracy is good.';\r\n\r\n                }\r\n\r\n                else if (accuracy <= 20) {\r\n\r\n                    result.innerHTML +=\r\n                        '<br><br>\ud83d\udfe1 GPS accuracy is acceptable.';\r\n\r\n                }\r\n\r\n                else {\r\n\r\n                    result.innerHTML +=\r\n                        '<br><br>\ud83d\udd34 GPS accuracy is poor. Please move to an open area and try again.';\r\n\r\n                }\r\n\r\n\r\n                button.innerText =\r\n                    '\u2713 Location Captured';\r\n\r\n                button.disabled = false;\r\n\r\n\r\n            },\r\n\r\n\r\n            function (error) {\r\n\r\n\r\n                button.innerText =\r\n                    '\ud83d\udccd Get Current Location';\r\n\r\n                button.disabled = false;\r\n\r\n\r\n                let message =\r\n                    'Unable to get your location.';\r\n\r\n\r\n                if (error.code === 1) {\r\n\r\n                    message =\r\n                        '\u274c Location permission denied. Please allow location access.';\r\n\r\n                }\r\n\r\n                else if (error.code === 2) {\r\n\r\n                    message =\r\n                        '\u274c Location unavailable. Please turn on GPS\/location services.';\r\n\r\n                }\r\n\r\n                else if (error.code === 3) {\r\n\r\n                    message =\r\n                        '\u26a0\ufe0f GPS request timed out. Please try again in an open area.';\r\n\r\n                }\r\n\r\n\r\n                result.innerHTML =\r\n                    message;\r\n\r\n\r\n            },\r\n\r\n\r\n            {\r\n\r\n                enableHighAccuracy: true,\r\n\r\n                timeout: 30000,\r\n\r\n                maximumAge: 0\r\n\r\n            }\r\n\r\n        );\r\n\r\n    });\r\n\r\n});\r\n\r\n<\/script>\r\n\r\n\r\n<style>\r\n\r\n#vf-gps-box {\r\n    width: 100%;\r\n}\r\n\r\n\r\n.vf-gps-button {\r\n\r\n    width: 100%;\r\n\r\n    padding: 16px 20px;\r\n\r\n    border: none;\r\n\r\n    border-radius: 12px;\r\n\r\n    background: #5B8C51;\r\n\r\n    color: #ffffff;\r\n\r\n    font-size: 16px;\r\n\r\n    font-weight: 600;\r\n\r\n    cursor: pointer;\r\n\r\n}\r\n\r\n\r\n.vf-gps-button:disabled {\r\n\r\n    opacity: 0.7;\r\n\r\n    cursor: wait;\r\n\r\n}\r\n\r\n\r\n.vf-gps-result {\r\n\r\n    margin-top: 12px;\r\n\r\n    padding: 14px;\r\n\r\n    border-radius: 10px;\r\n\r\n    background: #f5f7f5;\r\n\r\n    color: #333333;\r\n\r\n    font-size: 14px;\r\n\r\n    line-height: 1.7;\r\n\r\n}\r\n\r\n<\/style>\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-6ce3658 e-flex e-con-boxed e-con e-parent\" data-id=\"6ce3658\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-7f90cee elementor-widget elementor-widget-html\" data-id=\"7f90cee\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t\t<div id=\"vf-boundary-box\">\r\n\r\n    <!-- MAP -->\r\n    <div id=\"vf-boundary-map\"><\/div>\r\n\r\n    <!-- LIVE INFO -->\r\n    <div id=\"vf-boundary-info\">\r\n\r\n        <div class=\"vf-info-item\">\r\n            <span>GPS Points<\/span>\r\n            <strong id=\"vf-point-count\">0<\/strong>\r\n        <\/div>\r\n\r\n        <div class=\"vf-info-item\">\r\n            <span>Estimated Area<\/span>\r\n            <strong id=\"vf-live-acreage\">0.00 Acres<\/strong>\r\n        <\/div>\r\n\r\n        <div class=\"vf-info-item\">\r\n            <span>GPS Accuracy<\/span>\r\n            <strong id=\"vf-gps-accuracy\">--<\/strong>\r\n        <\/div>\r\n\r\n    <\/div>\r\n\r\n    <!-- BUTTONS -->\r\n\r\n    <button type=\"button\"\r\n            id=\"vf-boundary-start\"\r\n            class=\"vf-boundary-btn\">\r\n        \ud83d\uddfa\ufe0f Start Field Boundary Scan\r\n    <\/button>\r\n\r\n    <button type=\"button\"\r\n            id=\"vf-boundary-finish\"\r\n            class=\"vf-boundary-btn vf-finish\"\r\n            style=\"display:none;\">\r\n        \u23f9 Finish Boundary Scan\r\n    <\/button>\r\n\r\n    <div id=\"vf-boundary-status\"><\/div>\r\n\r\n<\/div>\r\n\r\n\r\n<!-- LEAFLET CSS -->\r\n\r\n<link\r\n    rel=\"stylesheet\"\r\n    href=\"https:\/\/unpkg.com\/leaflet@1.9.4\/dist\/leaflet.css\"\r\n\/>\r\n\r\n\r\n<!-- LEAFLET JS -->\r\n\r\n<script src=\"https:\/\/unpkg.com\/leaflet@1.9.4\/dist\/leaflet.js\"><\/script>\r\n\r\n\r\n<script>\r\n\r\ndocument.addEventListener('DOMContentLoaded', function () {\r\n\r\n\r\n    \/* ==============================\r\n       ELEMENTS\r\n    ============================== *\/\r\n\r\n    const startButton =\r\n        document.getElementById('vf-boundary-start');\r\n\r\n    const finishButton =\r\n        document.getElementById('vf-boundary-finish');\r\n\r\n    const status =\r\n        document.getElementById('vf-boundary-status');\r\n\r\n    const pointCount =\r\n        document.getElementById('vf-point-count');\r\n\r\n    const liveAcreage =\r\n        document.getElementById('vf-live-acreage');\r\n\r\n    const gpsAccuracy =\r\n        document.getElementById('vf-gps-accuracy');\r\n\r\n\r\n    \/* ==============================\r\n       VARIABLES\r\n    ============================== *\/\r\n\r\n    let map = null;\r\n\r\n    let polygon = null;\r\n\r\n    let polyline = null;\r\n\r\n    let currentMarker = null;\r\n\r\n    let watchID = null;\r\n\r\n    let points = [];\r\n\r\n    let firstLocation = true;\r\n\r\n\r\n    \/* ==============================\r\n       INITIALIZE MAP\r\n    ============================== *\/\r\n\r\n    map = L.map(\r\n        'vf-boundary-map'\r\n    ).setView(\r\n        [31.6340, 74.8723],\r\n        15\r\n    );\r\n\r\n\r\n    \/* SATELLITE MAP *\/\r\n\r\n    L.tileLayer(\r\n        'https:\/\/{s}.tile.openstreetmap.org\/{z}\/{x}\/{y}.png',\r\n        {\r\n            maxZoom: 22,\r\n            attribution:\r\n                '&copy; OpenStreetMap contributors'\r\n        }\r\n    ).addTo(map);\r\n\r\n\r\n    \/* ==============================\r\n       START SCAN\r\n    ============================== *\/\r\n\r\n    startButton.addEventListener(\r\n        'click',\r\n        function () {\r\n\r\n\r\n            if (!navigator.geolocation) {\r\n\r\n                alert(\r\n                    'GPS is not supported on this device.'\r\n                );\r\n\r\n                return;\r\n            }\r\n\r\n\r\n            \/* RESET OLD DATA *\/\r\n\r\n            points = [];\r\n\r\n            firstLocation = true;\r\n\r\n\r\n            if (polygon) {\r\n\r\n                map.removeLayer(polygon);\r\n\r\n                polygon = null;\r\n            }\r\n\r\n\r\n            if (polyline) {\r\n\r\n                map.removeLayer(polyline);\r\n\r\n                polyline = null;\r\n            }\r\n\r\n\r\n            if (currentMarker) {\r\n\r\n                map.removeLayer(currentMarker);\r\n\r\n                currentMarker = null;\r\n            }\r\n\r\n\r\n            pointCount.innerText = '0';\r\n\r\n            liveAcreage.innerText =\r\n                '0.00 Acres';\r\n\r\n            gpsAccuracy.innerText =\r\n                '--';\r\n\r\n\r\n            sessionStorage.removeItem(\r\n                'vf_field_acreage'\r\n            );\r\n\r\n            sessionStorage.removeItem(\r\n                'vf_boundary_points'\r\n            );\r\n\r\n            sessionStorage.removeItem(\r\n                'vf_boundary_completed'\r\n            );\r\n\r\n\r\n            startButton.style.display =\r\n                'none';\r\n\r\n            finishButton.style.display =\r\n                'block';\r\n\r\n\r\n            status.innerHTML =\r\n                '\ud83d\udccd <strong>Scanning started...<\/strong><br>' +\r\n                'Walk around the complete field boundary.';\r\n\r\n\r\n            \/* ==============================\r\n               GPS TRACKING\r\n            ============================== *\/\r\n\r\n            watchID =\r\n                navigator.geolocation.watchPosition(\r\n\r\n                    function (position) {\r\n\r\n\r\n                        const lat =\r\n                            position.coords.latitude;\r\n\r\n                        const lng =\r\n                            position.coords.longitude;\r\n\r\n                        const accuracy =\r\n                            position.coords.accuracy;\r\n\r\n\r\n                        gpsAccuracy.innerText =\r\n                            '\u00b1 ' +\r\n                            Math.round(accuracy) +\r\n                            ' m';\r\n\r\n\r\n                        \/* IGNORE BAD GPS *\/\r\n\r\n                        if (accuracy > 15) {\r\n\r\n                            status.innerHTML =\r\n                                '\u26a0\ufe0f Waiting for better GPS signal...<br>' +\r\n                                'Current accuracy: \u00b1 ' +\r\n                                Math.round(accuracy) +\r\n                                ' meters';\r\n\r\n                            return;\r\n                        }\r\n\r\n\r\n                        \/* MOVE MAP TO FIRST LOCATION *\/\r\n\r\n                        if (firstLocation) {\r\n\r\n                            map.setView(\r\n                                [lat, lng],\r\n                                19\r\n                            );\r\n\r\n                            firstLocation = false;\r\n                        }\r\n\r\n\r\n                        \/* CHECK DISTANCE *\/\r\n\r\n                        if (points.length > 0) {\r\n\r\n                            const previous =\r\n                                points[\r\n                                    points.length - 1\r\n                                ];\r\n\r\n\r\n                            const distance =\r\n                                distanceMeters(\r\n\r\n                                    previous.lat,\r\n                                    previous.lng,\r\n\r\n                                    lat,\r\n                                    lng\r\n\r\n                                );\r\n\r\n\r\n                            \/* IGNORE VERY CLOSE POINTS *\/\r\n\r\n                            if (distance < 4) {\r\n\r\n                                updateCurrentMarker(\r\n                                    lat,\r\n                                    lng\r\n                                );\r\n\r\n                                return;\r\n                            }\r\n\r\n\r\n                            \/* IGNORE HUGE GPS JUMPS *\/\r\n\r\n                            if (distance > 100) {\r\n\r\n                                status.innerHTML =\r\n                                    '\u26a0\ufe0f GPS jump detected. Ignoring incorrect point.';\r\n\r\n                                return;\r\n                            }\r\n\r\n                        }\r\n\r\n\r\n                        \/* SAVE GPS POINT *\/\r\n\r\n                        points.push({\r\n\r\n                            lat: lat,\r\n\r\n                            lng: lng\r\n\r\n                        });\r\n\r\n\r\n                        \/* UPDATE MAP *\/\r\n\r\n                        updateBoundaryMap();\r\n\r\n\r\n                        \/* UPDATE LIVE AREA *\/\r\n\r\n                        if (points.length >= 3) {\r\n\r\n                            const area =\r\n                                calculateArea(points);\r\n\r\n                            const acres =\r\n                                area \/\r\n                                4046.8564224;\r\n\r\n\r\n                            liveAcreage.innerText =\r\n                                acres.toFixed(2) +\r\n                                ' Acres';\r\n\r\n                        }\r\n\r\n\r\n                        pointCount.innerText =\r\n                            points.length;\r\n\r\n\r\n                        status.innerHTML =\r\n                            '\ud83d\udccd <strong>Scanning...<\/strong><br>' +\r\n                            'Walk around the complete boundary.';\r\n\r\n\r\n                    },\r\n\r\n\r\n                    function (error) {\r\n\r\n\r\n                        console.log(\r\n                            'GPS Error:',\r\n                            error\r\n                        );\r\n\r\n\r\n                        if (error.code === 1) {\r\n\r\n                            status.innerHTML =\r\n                                '\u274c Location permission denied.';\r\n\r\n                        }\r\n\r\n                        else if (error.code === 2) {\r\n\r\n                            status.innerHTML =\r\n                                '\u274c GPS unavailable. Please enable location.';\r\n\r\n                        }\r\n\r\n                        else if (error.code === 3) {\r\n\r\n                            status.innerHTML =\r\n                                '\u26a0\ufe0f GPS timeout. Trying again...';\r\n\r\n                        }\r\n\r\n\r\n                    },\r\n\r\n\r\n                    {\r\n\r\n                        enableHighAccuracy: true,\r\n\r\n                        maximumAge: 0,\r\n\r\n                        timeout: 15000\r\n\r\n                    }\r\n\r\n                );\r\n\r\n\r\n        }\r\n    );\r\n\r\n\r\n\r\n    \/* ==============================\r\n       UPDATE MAP\r\n    ============================== *\/\r\n\r\n    function updateBoundaryMap() {\r\n\r\n\r\n        const latLngs =\r\n            points.map(\r\n                function (point) {\r\n\r\n                    return [\r\n\r\n                        point.lat,\r\n\r\n                        point.lng\r\n\r\n                    ];\r\n\r\n                }\r\n            );\r\n\r\n\r\n        \/* REMOVE OLD POLYGON *\/\r\n\r\n        if (polygon) {\r\n\r\n            map.removeLayer(\r\n                polygon\r\n            );\r\n\r\n        }\r\n\r\n\r\n        \/* REMOVE OLD LINE *\/\r\n\r\n        if (polyline) {\r\n\r\n            map.removeLayer(\r\n                polyline\r\n            );\r\n\r\n        }\r\n\r\n\r\n        \/* DRAW LINE *\/\r\n\r\n        if (latLngs.length >= 2) {\r\n\r\n            polyline =\r\n                L.polyline(\r\n                    latLngs,\r\n                    {\r\n                        color: '#5B8C51',\r\n                        weight: 4\r\n                    }\r\n                ).addTo(map);\r\n\r\n        }\r\n\r\n\r\n        \/* DRAW POLYGON *\/\r\n\r\n        if (latLngs.length >= 3) {\r\n\r\n            polygon =\r\n                L.polygon(\r\n                    latLngs,\r\n                    {\r\n                        color: '#da826a',\r\n                        weight: 3,\r\n                        fillColor: '#5B8C51',\r\n                        fillOpacity: 0.25\r\n                    }\r\n                ).addTo(map);\r\n\r\n        }\r\n\r\n\r\n        \/* CURRENT GPS MARKER *\/\r\n\r\n        const lastPoint =\r\n            points[\r\n                points.length - 1\r\n            ];\r\n\r\n\r\n        updateCurrentMarker(\r\n            lastPoint.lat,\r\n            lastPoint.lng\r\n        );\r\n\r\n\r\n        \/* KEEP MAP CENTERED *\/\r\n\r\n        map.panTo(\r\n            [\r\n                lastPoint.lat,\r\n                lastPoint.lng\r\n            ]\r\n        );\r\n\r\n\r\n    }\r\n\r\n\r\n\r\n    \/* ==============================\r\n       UPDATE CURRENT LOCATION MARKER\r\n    ============================== *\/\r\n\r\n    function updateCurrentMarker(\r\n        lat,\r\n        lng\r\n    ) {\r\n\r\n\r\n        if (currentMarker) {\r\n\r\n            currentMarker.setLatLng(\r\n                [\r\n                    lat,\r\n                    lng\r\n                ]\r\n            );\r\n\r\n        }\r\n\r\n        else {\r\n\r\n            currentMarker =\r\n                L.circleMarker(\r\n                    [\r\n                        lat,\r\n                        lng\r\n                    ],\r\n                    {\r\n                        radius: 8,\r\n                        color: '#012264',\r\n                        fillColor: '#012264',\r\n                        fillOpacity: 1\r\n                    }\r\n                ).addTo(map);\r\n\r\n        }\r\n\r\n\r\n    }\r\n\r\n\r\n\r\n    \/* ==============================\r\n       FINISH SCAN\r\n    ============================== *\/\r\n\r\n    finishButton.addEventListener(\r\n        'click',\r\n        function () {\r\n\r\n\r\n            if (watchID !== null) {\r\n\r\n                navigator.geolocation.clearWatch(\r\n                    watchID\r\n                );\r\n\r\n                watchID = null;\r\n\r\n            }\r\n\r\n\r\n            \/* CHECK POINTS *\/\r\n\r\n            if (points.length < 3) {\r\n\r\n                alert(\r\n                    'Not enough GPS points. Please walk around the field boundary.'\r\n                );\r\n\r\n\r\n                startButton.style.display =\r\n                    'block';\r\n\r\n                finishButton.style.display =\r\n                    'none';\r\n\r\n                return;\r\n\r\n            }\r\n\r\n\r\n            \/* CALCULATE AREA *\/\r\n\r\n            const area =\r\n                calculateArea(points);\r\n\r\n\r\n            const acres =\r\n                area \/\r\n                4046.8564224;\r\n\r\n\r\n            \/* SAVE DATA *\/\r\n\r\n            sessionStorage.setItem(\r\n\r\n                'vf_field_acreage',\r\n\r\n                acres.toFixed(2)\r\n\r\n            );\r\n\r\n\r\n            sessionStorage.setItem(\r\n\r\n                'vf_boundary_points',\r\n\r\n                JSON.stringify(points)\r\n\r\n            );\r\n\r\n\r\n            sessionStorage.setItem(\r\n\r\n                'vf_boundary_completed',\r\n\r\n                'true'\r\n\r\n            );\r\n\r\n\r\n            \/* FIT MAP TO FIELD *\/\r\n\r\n            if (polygon) {\r\n\r\n                map.fitBounds(\r\n                    polygon.getBounds(),\r\n                    {\r\n                        padding: [30, 30]\r\n                    }\r\n                );\r\n\r\n            }\r\n\r\n\r\n            \/* SHOW RESULT *\/\r\n\r\n            status.innerHTML =\r\n                '<strong>\u2705 Boundary Complete<\/strong><br>' +\r\n                'GPS Points: ' +\r\n                points.length +\r\n                '<br>' +\r\n                'Final Area: <strong>' +\r\n                acres.toFixed(2) +\r\n                ' Acres<\/strong>';\r\n\r\n\r\n            finishButton.style.display =\r\n                'none';\r\n\r\n            startButton.style.display =\r\n                'block';\r\n\r\n\r\n        }\r\n    );\r\n\r\n\r\n\r\n    \/* ==============================\r\n       DISTANCE CALCULATION\r\n    ============================== *\/\r\n\r\n    function distanceMeters(\r\n\r\n        lat1,\r\n        lon1,\r\n\r\n        lat2,\r\n        lon2\r\n\r\n    ) {\r\n\r\n\r\n        const R = 6371000;\r\n\r\n\r\n        const dLat =\r\n            (\r\n                lat2 - lat1\r\n            ) *\r\n            Math.PI \/\r\n            180;\r\n\r\n\r\n        const dLon =\r\n            (\r\n                lon2 - lon1\r\n            ) *\r\n            Math.PI \/\r\n            180;\r\n\r\n\r\n        const a =\r\n\r\n            Math.sin(\r\n                dLat \/ 2\r\n            ) *\r\n\r\n            Math.sin(\r\n                dLat \/ 2\r\n            )\r\n\r\n            +\r\n\r\n            Math.cos(\r\n                lat1 *\r\n                Math.PI \/\r\n                180\r\n            )\r\n\r\n            *\r\n\r\n            Math.cos(\r\n                lat2 *\r\n                Math.PI \/\r\n                180\r\n            )\r\n\r\n            *\r\n\r\n            Math.sin(\r\n                dLon \/ 2\r\n            )\r\n\r\n            *\r\n\r\n            Math.sin(\r\n                dLon \/ 2\r\n            );\r\n\r\n\r\n        const c =\r\n\r\n            2 *\r\n\r\n            Math.atan2(\r\n\r\n                Math.sqrt(a),\r\n\r\n                Math.sqrt(\r\n                    1 - a\r\n                )\r\n\r\n            );\r\n\r\n\r\n        return R * c;\r\n\r\n\r\n    }\r\n\r\n\r\n\r\n    \/* ==============================\r\n       CALCULATE POLYGON AREA\r\n    ============================== *\/\r\n\r\n    function calculateArea(points) {\r\n\r\n\r\n        const R =\r\n            6378137;\r\n\r\n\r\n        const firstLat =\r\n            points[0].lat *\r\n            Math.PI \/\r\n            180;\r\n\r\n\r\n        const firstLng =\r\n            points[0].lng *\r\n            Math.PI \/\r\n            180;\r\n\r\n\r\n        const coordinates =\r\n            points.map(\r\n                function (point) {\r\n\r\n\r\n                    const lat =\r\n                        point.lat *\r\n                        Math.PI \/\r\n                        180;\r\n\r\n\r\n                    const lng =\r\n                        point.lng *\r\n                        Math.PI \/\r\n                        180;\r\n\r\n\r\n                    return {\r\n\r\n                        x:\r\n\r\n                            R *\r\n\r\n                            (\r\n                                lng -\r\n                                firstLng\r\n                            )\r\n\r\n                            *\r\n\r\n                            Math.cos(\r\n                                firstLat\r\n                            ),\r\n\r\n\r\n                        y:\r\n\r\n                            R *\r\n\r\n                            (\r\n                                lat -\r\n                                firstLat\r\n                            )\r\n\r\n                    };\r\n\r\n\r\n                }\r\n            );\r\n\r\n\r\n        let area =\r\n            0;\r\n\r\n\r\n        for (\r\n\r\n            let i = 0;\r\n\r\n            i <\r\n            coordinates.length;\r\n\r\n            i++\r\n\r\n        ) {\r\n\r\n\r\n            const j =\r\n\r\n                (\r\n                    i + 1\r\n                )\r\n\r\n                %\r\n\r\n                coordinates.length;\r\n\r\n\r\n            area +=\r\n\r\n                coordinates[i].x *\r\n\r\n                coordinates[j].y\r\n\r\n                -\r\n\r\n                coordinates[j].x *\r\n\r\n                coordinates[i].y;\r\n\r\n\r\n        }\r\n\r\n\r\n        return Math.abs(\r\n            area\r\n        ) \/\r\n        2;\r\n\r\n\r\n    }\r\n\r\n\r\n});\r\n\r\n<\/script>\r\n\r\n\r\n\r\n<style>\r\n\r\n\/* ==============================\r\n   MAIN BOX\r\n============================== *\/\r\n\r\n#vf-boundary-box {\r\n\r\n    width: 100%;\r\n\r\n}\r\n\r\n\r\n\/* ==============================\r\n   MAP\r\n============================== *\/\r\n\r\n#vf-boundary-map {\r\n\r\n    width: 100%;\r\n\r\n    height: 400px;\r\n\r\n    border-radius: 16px;\r\n\r\n    overflow: hidden;\r\n\r\n    margin-bottom: 15px;\r\n\r\n    border: 1px solid #e5e5e5;\r\n\r\n}\r\n\r\n\r\n\/* ==============================\r\n   INFO BOX\r\n============================== *\/\r\n\r\n#vf-boundary-info {\r\n\r\n    display: grid;\r\n\r\n    grid-template-columns:\r\n        repeat(3, 1fr);\r\n\r\n    gap: 10px;\r\n\r\n    margin-bottom: 15px;\r\n\r\n}\r\n\r\n\r\n.vf-info-item {\r\n\r\n    background: #f6f8f5;\r\n\r\n    padding: 12px 8px;\r\n\r\n    border-radius: 10px;\r\n\r\n    text-align: center;\r\n\r\n}\r\n\r\n\r\n.vf-info-item span {\r\n\r\n    display: block;\r\n\r\n    font-size: 12px;\r\n\r\n    color: #777;\r\n\r\n    margin-bottom: 5px;\r\n\r\n}\r\n\r\n\r\n.vf-info-item strong {\r\n\r\n    display: block;\r\n\r\n    font-size: 14px;\r\n\r\n    color: #012264;\r\n\r\n}\r\n\r\n\r\n\/* ==============================\r\n   BUTTON\r\n============================== *\/\r\n\r\n.vf-boundary-btn {\r\n\r\n    width: 100%;\r\n\r\n    padding: 16px 20px;\r\n\r\n    border: none;\r\n\r\n    border-radius: 12px;\r\n\r\n    background: #5B8C51;\r\n\r\n    color: #ffffff;\r\n\r\n    font-size: 16px;\r\n\r\n    font-weight: 600;\r\n\r\n    cursor: pointer;\r\n\r\n}\r\n\r\n\r\n.vf-boundary-btn.vf-finish {\r\n\r\n    background: #da826a;\r\n\r\n}\r\n\r\n\r\n\/* ==============================\r\n   STATUS\r\n============================== *\/\r\n\r\n#vf-boundary-status {\r\n\r\n    margin-top: 12px;\r\n\r\n    padding: 12px;\r\n\r\n    background: #f6f8f5;\r\n\r\n    border-radius: 10px;\r\n\r\n    font-size: 14px;\r\n\r\n    line-height: 1.6;\r\n\r\n}\r\n\r\n\r\n\/* ==============================\r\n   MOBILE\r\n============================== *\/\r\n\r\n@media (max-width: 600px) {\r\n\r\n    #vf-boundary-map {\r\n\r\n        height: 350px;\r\n\r\n    }\r\n\r\n\r\n    #vf-boundary-info {\r\n\r\n        grid-template-columns:\r\n            repeat(3, 1fr);\r\n\r\n    }\r\n\r\n\r\n    .vf-info-item strong {\r\n\r\n        font-size: 12px;\r\n\r\n    }\r\n\r\n}\r\n\r\n<\/style>\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-16f870e e-con-full e-flex e-con e-parent\" data-id=\"16f870e\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-59d42d6 elementor-align-justify elementor-mobile-align-justify elementor-widget elementor-widget-button\" data-id=\"59d42d6\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"button.default\">\n\t\t\t\t\t\t\t\t\t\t<a class=\"elementor-button elementor-button-link elementor-size-sm\" href=\"https:\/\/vipashafarms.in\/new-field\/\">\n\t\t\t\t\t\t<span class=\"elementor-button-content-wrapper\">\n\t\t\t\t\t\t<span class=\"elementor-button-icon\">\n\t\t\t\t<svg aria-hidden=\"true\" class=\"e-font-icon-svg e-fas-pencil-alt\" viewBox=\"0 0 512 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M497.9 142.1l-46.1 46.1c-4.7 4.7-12.3 4.7-17 0l-111-111c-4.7-4.7-4.7-12.3 0-17l46.1-46.1c18.7-18.7 49.1-18.7 67.9 0l60.1 60.1c18.8 18.7 18.8 49.1 0 67.9zM284.2 99.8L21.6 362.4.4 483.9c-2.9 16.4 11.4 30.6 27.8 27.8l121.5-21.3 262.6-262.6c4.7-4.7 4.7-12.3 0-17l-111-111c-4.8-4.7-12.4-4.7-17.1 0zM124.1 339.9c-5.5-5.5-5.5-14.3 0-19.8l154-154c5.5-5.5 14.3-5.5 19.8 0s5.5 14.3 0 19.8l-154 154c-5.5 5.5-14.3 5.5-19.8 0zM88 424h48v36.3l-64.5 11.3-31.1-31.1L51.7 376H88v48z\"><\/path><\/svg>\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t<span class=\"elementor-button-text\">Create New Field<\/span>\n\t\t\t\t\t<\/span>\n\t\t\t\t\t<\/a>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Capture your field location, boundary and crop details. \ud83d\udccd Get Current Location GPS Points 0 Estimated Area 0.00 Acres GPS Accuracy &#8212; \ud83d\uddfa\ufe0f Start Field Boundary Scan \u23f9 Finish Boundary Scan Create New Field<\/p>","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"footnotes":""},"class_list":["post-448","page","type-page","status-publish","hentry"],"acf":[],"_hostinger_reach_plugin_has_subscription_block":false,"_hostinger_reach_plugin_is_elementor":false,"_links":{"self":[{"href":"https:\/\/vipashafarms.in\/pa\/wp-json\/wp\/v2\/pages\/448","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vipashafarms.in\/pa\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/vipashafarms.in\/pa\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/vipashafarms.in\/pa\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vipashafarms.in\/pa\/wp-json\/wp\/v2\/comments?post=448"}],"version-history":[{"count":115,"href":"https:\/\/vipashafarms.in\/pa\/wp-json\/wp\/v2\/pages\/448\/revisions"}],"predecessor-version":[{"id":687,"href":"https:\/\/vipashafarms.in\/pa\/wp-json\/wp\/v2\/pages\/448\/revisions\/687"}],"wp:attachment":[{"href":"https:\/\/vipashafarms.in\/pa\/wp-json\/wp\/v2\/media?parent=448"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}