🏡 index : github.com/shreyas-satish/govote.git

author Nemo <me@captnemo.in> 2023-12-08 1:04:13.0 +05:30:00
committer Nemo <me@captnemo.in> 2023-12-08 1:04:13.0 +05:30:00
commit
7a105723be76a0a51bc7762914d318af2d5c064e [patch]
tree
07f344defb2e84d01a58b5545c0b30ff7e4d30a7
parent
58ec204da90dd477e0c93354c7b36ba86966f966
download
7a105723be76a0a51bc7762914d318af2d5c064e.tar.gz

adds district



Diff

 faq.md           |  2 +-
 index.html       |  1 +
 assets/script.js | 51 +++++++++++++++++++++++++++++++++++++++++++++++++--
 assets/style.css |  4 ++++
 4 files changed, 54 insertions(+), 4 deletions(-)

diff --git a/faq.md b/faq.md
index 66cb598..7fe740a 100644
--- a/faq.md
+++ a/faq.md
@@ -22,4 +22,4 @@

### I want to help

Share this with your friends and family. Get them to register to vote. Reach out if they face any issues.
Share this with your friends and family. Get them to register to vote. Reach out if they face any issues.
diff --git a/index.html b/index.html
index 844a9ee..fcf52a2 100644
--- a/index.html
+++ a/index.html
@@ -108,6 +108,7 @@
                nvsp.in earlier, the same one is valid here.
            </p>
            <p>2. Go <a href="https://voters.eci.gov.in/login" target="_blank">here</a>, and submit Form 8 (or Form 6 if you've never had a voter ID) using the credentials you signed up with.</p>
            <div id="location-details"></div>
            <p>
                For address proof, you can use any of:
            </p>
diff --git a/assets/script.js b/assets/script.js
index e4b6117..ed35aaf 100644
--- a/assets/script.js
+++ a/assets/script.js
@@ -1,3 +1,40 @@
// A mapping from assembly constituency ID to
// PC ID, PC Name, ECI District
const CONSTITUENCY_MAP = {
  "150": ["27","Chikkaballapur","BANGALORE URBAN"],
  "151": ["24","Bangalore North","B.B.M.P (NORTH)"],
  "152": ["24","Bangalore North","BANGALORE URBAN"],
  "153": ["24","Bangalore North","BANGALORE URBAN"],
  "154": ["23","Bangalore Rural","B.B.M.P (CENTRAL)"],
  "155": ["24","Bangalore North","BANGALORE URBAN"],
  "156": ["24","Bangalore North","B.B.M.P (NORTH)"],
  "157": ["24","Bangalore North","B.B.M.P (NORTH)"],
  "158": ["24","Bangalore North","B.B.M.P (NORTH)"],
  "159": ["24","Bangalore North","B.B.M.P (NORTH)"],
  "160": ["25","Bangalore Central","B.B.M.P (NORTH)"],
  "161": ["25","Bangalore Central","B.B.M.P (NORTH)"],
  "162": ["25","Bangalore Central","B.B.M.P (CENTRAL)"],
  "163": ["25","Bangalore Central","B.B.M.P (CENTRAL)"],
  "164": ["25","Bangalore Central","B.B.M.P (CENTRAL)"],
  "165": ["25","Bangalore Central","B.B.M.P (CENTRAL)"],
  "166": ["26","Bangalore South","B.B.M.P (SOUTH)"],
  "167": ["26","Bangalore South","B.B.M.P (SOUTH)"],
  "168": ["25","Bangalore Central","B.B.M.P (CENTRAL)"],
  "169": ["26","Bangalore South","B.B.M.P (CENTRAL)"],
  "170": ["26","Bangalore South","B.B.M.P (SOUTH)"],
  "171": ["26","Bangalore South","B.B.M.P (SOUTH)"],
  "172": ["26","Bangalore South","B.B.M.P (SOUTH)"],
  "173": ["26","Bangalore South","B.B.M.P (SOUTH)"],
  "174": ["25","Bangalore Central","BANGALORE URBAN"],
  "175": ["26","Bangalore South","B.B.M.P (SOUTH)"],
  "176": ["23","Bangalore Rural","BANGALORE URBAN"],
  "177": ["23","Bangalore Rural","BANGALORE URBAN"],
  "178": ["27","Chikkaballapur","BANGALORE RURAL"],
  "179": ["27","Chikkaballapur","BANGALORE RURAL"],
  "180": ["27","Chikkaballapur","BANGALORE RURAL"],
  "181": ["27","Chikkaballapur","BANGALORE RURAL"]
}

function findFeaturesContainingPoint(geojson, pointCoordinates) {
  
    const matchingFeatures = [];
@@ -19,7 +56,6 @@
loadJSONFile("/assets/pincodes.json").then((pincodeMap) =>{
  const pincodeInput = document.getElementById('pincode');
  pincodeInput.addEventListener('input', (e) => {
    console.log(e.target)
    if (e.target.value.length == 6) {
      let postOffice = pincodeMap[pincodeInput.value];
      if (postOffice) {
@@ -173,11 +209,20 @@
    let details = "Not in a Bangalore Constituency"
    if (features.length == 1) {
      ward = window.ward = wardLookup[features[0].properties['id'].toString()]
      let acID = ward['ac_id'];
      let pcId = CONSTITUENCY_MAP[acID][0];
      let pcName = CONSTITUENCY_MAP[acID][1];
      let eciDistrict = CONSTITUENCY_MAP[acID][2];
      details = `<div>
      <strong>Assembly Constituency</strong>: ${ward['ac_id']} - ${ward['ac_name']}<br>
      <br><br>Parliamentary Constituency: <br>${ward['pc_id']} - ${ward['pc_name']}<br>
      <br><br>Ward: <br>${ward['id']} - ${ward['name']}
      <strong>District</strong>: ${eciDistrict}<br>
      <br>Parliamentary Constituency: <br>${pcId} - ${pcName}<br>
      <br>Ward: <br>${ward['id']} - ${ward['name']}
      </div>`;

      console.log(details)

      document.getElementById('location-details').innerHTML = details;
    }
    infowindow.setContent(details);
    infowindow.open(map, marker);
diff --git a/assets/style.css b/assets/style.css
index a4effa4..567a469 100644
--- a/assets/style.css
+++ a/assets/style.css
@@ -157,4 +157,8 @@

.section::after {
  content: "";
}

#location-details {
    border: 1px dashed grey;
}