Coder Social home page Coder Social logo

pawagit / randomch Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 86 KB

A Google Apps Script (GAS) powered Openlayers 6 (OL6) Web App making use of the Swisstopo's GeoAdmin REST API and WMTS services

License: MIT License

HTML 96.19% JavaScript 3.81%
gas google-apps-script ol6 openlayers6 swisstopo wmts-layer geoadmin-api bootstrap5 dayjs favicon-generator

randomch's Introduction

randomCH

A Google Apps Script (GAS) powered Openlayers 6 (OL6) Web App making use of the Swisstopo's GeoAdmin REST API and WMTS services

tl;dr

This Google Apps Script Web App (GAS web app) takes the user to random locations within Switzerland and displays the location's name and altitude on the Swissimage orthophoto mosaic map.

The aim of this project is to learn and understand the underlying techniques and tools involved.
It serves as a personal quick reference for further projects.

Any improvement suggestions are appreciated! 😃

Technologies used

What does the Web App do?

  • Random Coordinates every 15 seconds, confined to Switzerland
    Every 15 seconds, the user is taken to a random location gefencenced to the territory of Switzerland. From this location, the view is slowly panning in a random direction until the next location is focused.
  • 10k last visited places as Point Vector Layer
    The latest 10k random coordinates the app generated are fetched from the google spreadsheet and displayed as a point vector layer. They are clickable and feature a popover popup that also works in fullscreen mode.
  • Like a location → separate sheet
    Users can 'like' the current position. After the next reload, these locations show up as 'star' icons.
  • Telegram Share - Users can send the current location/info to a telegram chat
  • Fullscreen Mode - Users can toggle the fullscreen mode
  • Animation Control - Users can pause/start the anmiation
  • Next Location - Users can forward to the next random location
  • Info & Credentials Modal - An 'info' model displays information about the app.

How to get get your own copy of the app running?

  1. Clone the source or get a copy of this GAS project.
  2. Copy this template spreadsheet (stores point data generated by the app)
  3. Adjust the const SSID='MY_SPEADSHEET_ID' to the newly copied spreadsheet's ID
  4. Create a new deployment of the web app and visit the new Deployment Url

Details on what is used to build the app functionality

Google Apps Script / Google Workspace

  • Google Apps Script (GAS) - Standalone Project
  • Google Sheets - Store point data

Openlayers 6

  • proj4 - Swiss Coordinate System EPSG:2056 & EPSG:21781 definition and map projection
  • ol.format.GeoJSON() - Layer for Geofencing random coordinates
  • ol.source.XYZ() - SWISSIMAGE map layer
  • ol.source.Vector() - Point vector layer
  • ol.Overlay() - feature.on.click popover popup
  • ol.map.view.animate() - pan towards the target coordinates

GeoAdmin REST API

Bootstrap 5

  • popover
  • modal
  • class="position-absolute"
  • boxicons

Screen Wake Lock API

  • lock, release, handleVisibilityChange

Day.js

  • custom Swiss Locale (Schwiizerdüütsch)

Javascript

  • jQuery basics
  • setTimeout(), clearTimeout()
  • setInterval(), clearInterval()
  • google.script.run.withSuccessHandler()
  • parallel asyc calls awaited for further processing

HTML

  • GAS Web App Embedding - Iframe hosting page (custom URL rewrite, allow whitelist)
  • favicon, shortcut icon - all platforms

CSS

  • no SASS ;-(
  • minimal customisations

randomch's People

Contributors

pawagit avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.