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
| dictionary: new Proxy({}, { | |
| get: function(target, key, receiver){ | |
| if (mapp.dictionaries[mapp.language][key]) { | |
| return mapp.dictionaries[mapp.language][key] | |
| } | |
| // Return english | |
| return mapp.dictionaries.en[key] | |
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
| mapp.utils.merge(mapp.dictionaries, { | |
| en: { | |
| location_clear_all: "Clear locations", | |
| }, | |
| de: { | |
| location_clear_all: "Entferne Auswahl" | |
| }, | |
| cn: { | |
| location_clear_all: "모든 위치 제거", | |
| }, |
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
| params.mapview.locations = new Proxy(params.mapview.locations, { | |
| set: function(target, key, location){ | |
| Reflect.set(...arguments) | |
| // code to add a location view element to the listview element in the DOM. | |
| return true | |
| }, |
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
| export default plugins => { | |
| if (!Array.isArray(plugins)) return; | |
| return new Promise(resolveAll=>{ | |
| const promises = plugins.map( | |
| plugin => | |
| new Promise((resolve, reject) => | |
| import(plugin) |
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
| document.dispatchEvent( | |
| new CustomEvent("myPlugin", { | |
| detail: (_xyz) => { | |
| console.log(_xyz) | |
| } | |
| } | |
| ) |
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 script = document.createElement("script") | |
| script.type = 'application/javascript' | |
| script.src = 'https://geolytix.github.com/GEOLYTIX/public/blob/v3/public/myPluginScript.js' | |
| let eventTriggered | |
| script.onload = () => { | |
| setTimeout(()=>{ |
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
| draw.interaction = new ol.interaction.Draw({ | |
| source: draw.Layer.getSource(), | |
| geometryFunction: draw.geometryFunction, | |
| freehand: draw.freehand, | |
| type: draw.type, | |
| style: draw.style, | |
| condition: e => { | |
| if (e.originalEvent.buttons === 1) { | |
| draw.vertices.push(e.coordinate); |
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 compose = (...fns) => { | |
| return arg => fns.reduce((acc, fn) => { | |
| return fn(acc); | |
| }, arg) | |
| } |
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 promise, maplibregl = null | |
| async function MaplibreGL() { | |
| // maplibre is loaded. | |
| if (maplibregl) return new maplibregl.Map(...arguments); | |
| // create a promise to check for the maplibre library | |
| if (!promise) promise = new Promise(async resolve => { |
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
| <script> | |
| alert("Hello World!"); | |
| </script> |
NewerOlder