This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const layerBase = new ol.layer.Tile({ | |
| source: new ol.source.OSM({ | |
| url: 'https://cartodb-basemaps-{a-d}.global.ssl.fastly.net/dark_nolabels/{z}/{x}/{y}.png', | |
| opaque: false, | |
| attributions: [] | |
| }) | |
| }); | |
| const sourceMVT = new ol.source.VectorTile({ | |
| cacheSize: 0, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const modifyInteraction = new ol.interaction.Modify({ | |
| source: sourceVector | |
| }); | |
| modifyInteraction.on('modifyend', e => { | |
| const feature = JSON.parse(geoJSON.writeFeature(e.features.getArray()[0])); | |
| const xhr = new XMLHttpRequest(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| btnDelete.onclick = function() { | |
| btnDelete.classList.remove('active'); | |
| if (!currentFeature) return; | |
| const xhr = new XMLHttpRequest(); | |
| xhr.open('GET', 'https://geolytix.xyz/dev/api/location/edit/delete?locale=GB&layer=Scratch&table=dev.scratch&id=' + currentFeature.getProperties().id); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let drawInteraction; | |
| let activeButton; | |
| const btnPoly = document.getElementById('btnPoly'); | |
| btnPoly.onclick = () => drawMethod(btnPoly, 'Polygon'); | |
| const btnLine = document.getElementById('btnLine'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| _xyz.mapview.highlight = { | |
| feature: null, | |
| layer: null, | |
| }; | |
| function pointermove(e){ | |
| // Get features from layers which have a highlight style. | |
| const featureArray = _xyz.map.getFeaturesAtPixel(e.pixel,{ | |
| // Filter for layers which have a highlight style. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # _z is the XYZ tiles zoom level of the request | |
| # _resolution is a resolution factor applied to determine the grid spacing | |
| # _r = parseInt(40075016.68 / Math.pow(2, _z) * _resolution) | |
| # _size is a numeric value for the calculation of a cell's size property | |
| # _cat is a numeric value for the calculation of a cell's graduated colour property | |
| # _table is the table name | |
| # _geom is the geometry field of points in the table | |
| # The geometries SRID is assumed to be 3857 | |
| SELECT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # _z is the XYZ tiles zoom level of the request | |
| # _resolution is a resolution factor applied to determine the grid spacing | |
| # _r = parseInt(40075016.68 / Math.pow(2, _z) * _resolution) | |
| # _size is a numeric value for the calculation of a cell's size property | |
| # _cat is a numeric value for the calculation of a cell's graduated colour property | |
| # _table is the table name | |
| # _geom is the geometry field of points in the table | |
| # The _width of a hexagon is equal to _r | |
| # The _height of a hexagon envelope is _r - ((_r * 2 / sqrt(3)) - _r) / 2; | |
| # The geometries SRID is assumed to be 3857 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const auth = require('../mod/auth/handler')({ | |
| public: true, | |
| login: true | |
| }) | |
| const _templates = require('../mod/workspace/templates') | |
| const templates = {} | |
| module.exports = async (req, res) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const provider = require('../provider') | |
| const templates = { | |
| //views | |
| _desktop: require('./views/desktop'), | |
| _mobile: require('./views/mobile'), | |
| _login: require('./views/login'), | |
| _register: require('./views/register'), | |
| admin_user: require('./views/admin_user'), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const auth = require('../../mod/auth/handler')({ | |
| public: true | |
| }) | |
| const dbs = require('../../mod/pg/dbs')() | |
| const _layers = require('../../mod/workspace/layers') | |
| const layers = [] |