A Google Apps Script (GAS) powered Openlayers 6 (OL6) Web App making use of the Swisstopo's GeoAdmin REST API and WMTS services
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! 😃
- Google Apps Script (GAS) - Standalone Project hosting the App
- Google Sheets - Store point data created by the app
- Bootstrap 5 - CSS Framework
- Openlayers 6 - Build the map
- Proj4 - Handle EPSG:2056 & EPSG:21781 coordinates (Swiss Coordinate System)
- GeoAdmin REST API - XYZ Tile Layer (map) and Data Query (overlay)
- Screen Wake Lock API - Avoid screen sleep on mobile devices
- Day.js - Apply custom Swiss Locale to timestamps (Schwiizerdüütsch)
- Favicon Generator. For real. - Create a cross-platform favicon pack
- 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.
- Clone the source or get a copy of this GAS project.
- Copy this template spreadsheet (stores point data generated by the app)
- Adjust the
const SSID='MY_SPEADSHEET_ID'
to the newly copied spreadsheet's ID - Create a new deployment of the web app and visit the new Deployment Url
- Google Apps Script (GAS) - Standalone Project
- Google Sheets - Store point data
- 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
- popover
- modal
- class="position-absolute"
- boxicons
- lock, release, handleVisibilityChange
- custom Swiss Locale (Schwiizerdüütsch)
- jQuery basics
- setTimeout(), clearTimeout()
- setInterval(), clearInterval()
- google.script.run.withSuccessHandler()
- parallel asyc calls awaited for further processing
- GAS Web App Embedding - Iframe hosting page (custom URL rewrite, allow whitelist)
- favicon, shortcut icon - all platforms
- no SASS ;-(
- minimal customisations