├── images └── website-look.png ├── css └── stylesheet.css ├── README.md ├── index.html └── js └── main.js /images/website-look.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fossasia/geolocation/HEAD/images/website-look.png -------------------------------------------------------------------------------- /css/stylesheet.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: #eee; 3 | font-family: Roboto, "Helvetica Neue", sans-serif; 4 | } 5 | 6 | h2 { 7 | color: #7c795d; 8 | font-family: 'Source Sans Pro', sans-serif; 9 | font-size: 32px; 10 | font-weight: 400; 11 | line-height: 40px; 12 | margin: 0 0 24px; 13 | text-align: center; 14 | margin-top: 10%; 15 | } 16 | 17 | .card { 18 | width: 60%; 19 | margin-left: 20%; 20 | margin-right: 20%; 21 | background: #FFF; 22 | text-align: center; 23 | margin-top: 2%; 24 | box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24); 25 | transition: all 0.3s cubic-bezier(.25,.8,.25,1); 26 | padding: 20px 0 20px 0; 27 | } 28 | 29 | .label { 30 | font-size: 18px; 31 | } 32 | 33 | #button { 34 | width: 40%; 35 | padding: 10px; 36 | cursor: pointer; 37 | border: none; 38 | background-color: #4285f4; 39 | color: #fff; 40 | font-size: 1.6vw; 41 | } 42 | 43 | #output { 44 | font-size: 15px; 45 | border-top: 1px solid #4285f4; 46 | padding-top:5px; 47 | margin-right:5%; 48 | margin-left:5%; 49 | width: 90%; 50 | } 51 | 52 | #output, #out { 53 | display: none; 54 | } 55 | 56 | #out * { 57 | margin-top: 10px; 58 | } 59 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Geolocation finder 2 | This website is the official website of Fossasia when it comes to geolocations. It finds geolocation for integration in multiple projects 3 | the community looks after. This is basically a mini-project of [FOSSASIA](https://fossasia.org/). 4 | 5 | ![website look](./images/website-look.png) 6 | 7 | ## Repositories currently using geolocation 8 | - [gci17.fossasia.org](https://github.com/fossasia/gci17.fossasia.org) 9 | - [gci18.fossasia.org](https://github.com/fossasia/gci18.fossasia.org) 10 | 11 | ## How to use geolocation for other projects 12 | The website currently supports only the [gci18.fossasia.org](https://github.com/fossasia/gci18.fossasia.org) repository where you can add the geo coordinates for mentors and students, the members of FOSSASIA are free to supply any further integrations, check the code in the index.html and do the needy. 13 | 14 | ### How to get geolocation 15 | - visit [geolocation website](https://fossasia.github.io/geolocation/) 16 | - click "Get my geolocation" button 17 | - copy the coordinates and paste where wanted (you can add them directly to Mentors file \[If you are a mentor] in supported repository by visiting link in the bottom 18 | 19 | ## Branches: 20 | We follow a simple branch framework, currently the gh-pages branch that should'nt amaze you right? 21 | 22 | ## Release History 23 | * 1.0 24 | * CHANGE: Project born 25 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Geolocator for FOSSASIA 10 | 11 | 12 |

Geo locator to faciliate easy integration of location data

13 |
14 |


15 | 16 |

17 | 18 | 19 | 20 |
21 |
22 |
23 | 24 | Mentors file [If you are a mentor]
25 | 26 |
27 |
28 |
Created with ♡ for FOSSASIA
29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /js/main.js: -------------------------------------------------------------------------------- 1 | let output = document.getElementById("output"); 2 | let out = document.getElementById("out") 3 | const geolocation = () => { 4 | if (navigator.geolocation) { 5 | navigator.geolocation.getCurrentPosition(rit, fileit); 6 | document.getElementById("button").value = "Get my geolocation again"; 7 | document.getElementById("button").onclick = "window.location.reload();"; // reloads and executes the geolocation(); 8 | } 9 | else { 10 | output.innerHTML = "Geolocation is not supported by this browser"; 11 | output.style.display = "inherit"; 12 | } 13 | } 14 | 15 | const rit = (position) => { 16 | let mylocation = `lat:${position.coords.latitude}
`; 17 | mylocation += `lng:${position.coords.longitude}

`; 18 | output.innerHTML = mylocation; 19 | my_preview = `https://www.google.com/maps/?q=${position.coords.latitude},${position.coords.longitude}`; 20 | preview.innerHTML = `OpenStreetMap contributors' 26 | }).addTo(map); 27 | let target = L.latLng(position.coords.latitude, position.coords.longitude); 28 | map.setView(target, 14); 29 | L.marker(target).addTo(map); 30 | output.style.display = "none"; 31 | output.style.display = "inherit"; 32 | out.style.display = "inherit"; 33 | } 34 | 35 | const fileit = (error) => { 36 | switch (error.code) { 37 | case error.PERMISSION_DENIED: 38 | output.innerHTML = "Permission Denied, please give permission and try again"; 39 | break; 40 | case error.POSITION_UNAVAILABLE: 41 | output.innerHTML = "Position information is unavailable please try after some time"; 42 | break; 43 | case error.TIMEOUT: 44 | output.innerHTML = "Request Timed out, please try again"; 45 | break; 46 | case error.UNKNOWN_ERROR: 47 | output.innerHTML = "Unknown Error please try again"; 48 | break; 49 | } 50 | } --------------------------------------------------------------------------------