25 |
26 |
27 |
40 |
--------------------------------------------------------------------------------
/packages/geoadmin-elevation-profile/vite.config.js:
--------------------------------------------------------------------------------
1 | import tailwindcss from '@tailwindcss/vite'
2 | import vue from '@vitejs/plugin-vue'
3 | import { resolve } from 'path'
4 | import { fileURLToPath, URL } from 'url'
5 | import dts from 'vite-plugin-dts'
6 | import vueDevTools from 'vite-plugin-vue-devtools'
7 |
8 |
9 | export default {
10 | build: {
11 | lib: {
12 | entry: [resolve(__dirname, 'src/index.ts')],
13 | name: '@geoadmin/elevation-profile',
14 | },
15 | rollupOptions: {
16 | external: ['vue', 'tailwindcss'],
17 | output: {
18 | exports: 'named',
19 | globals: {
20 | vue: 'Vue',
21 | }
22 | },
23 | },
24 | },
25 | resolve: {
26 | alias: {
27 | '@': fileURLToPath(new URL('./src', import.meta.url)),
28 | },
29 | },
30 | plugins: [
31 | tailwindcss(),
32 | vue(),
33 | vueDevTools(),
34 | dts(),
35 | ],
36 | }
37 |
--------------------------------------------------------------------------------
/packages/mapviewer/src/router/storeSync/NoSimpleZoomParamConfig.class.js:
--------------------------------------------------------------------------------
1 | import AbstractParamConfig, {
2 | STORE_DISPATCHER_ROUTER_PLUGIN,
3 | } from '@/router/storeSync/abstractParamConfig.class'
4 |
5 | const URL_PARAM_NAME = 'noSimpleZoom'
6 |
7 | export default class NoSimpleZoomParamConfig extends AbstractParamConfig {
8 | constructor() {
9 | super({
10 | urlParamName: URL_PARAM_NAME,
11 | mutationsToWatch: ['setNoSimpleZoomEmbed'],
12 | setValuesInStore: dispatchNoSimpleZoomFromUrlIntoStore,
13 | extractValueFromStore: (store) => store.state.ui.noSimpleZoomEmbed,
14 | keepInUrlWhenDefault: false,
15 | valueType: Boolean,
16 | })
17 | }
18 | }
19 |
20 | function dispatchNoSimpleZoomFromUrlIntoStore(to, store, urlParamValue) {
21 | if (to.path.toLowerCase().includes('embed')) {
22 | store.dispatch('setNoSimpleZoomEmbed', {
23 | noSimpleZoomEmbed: urlParamValue,
24 | dispatcher: STORE_DISPATCHER_ROUTER_PLUGIN,
25 | })
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/packages/mapviewer/src/store/modules/app.store.js:
--------------------------------------------------------------------------------
1 | /** Vuex module that tells if the app has finished loading (is ready to show stuff) */
2 | export default {
3 | state: {
4 | /**
5 | * Flag that tells if the app is ready to show data and the map
6 | *
7 | * @type Boolean
8 | */
9 | isReady: false,
10 |
11 | /**
12 | * Flag telling that the Map Module is ready. This is useful for E2E testing which should
13 | * not start before the Map Module is ready.
14 | */
15 | isMapReady: false,
16 | },
17 | getters: {},
18 | actions: {
19 | setAppIsReady: ({ commit }, { dispatcher }) => {
20 | commit('setAppIsReady', { dispatcher })
21 | },
22 | mapModuleReady: ({ commit }, { dispatcher }) => {
23 | commit('mapModuleReady', { dispatcher })
24 | },
25 | },
26 | mutations: {
27 | setAppIsReady: (state) => (state.isReady = true),
28 | mapModuleReady: (state) => (state.isMapReady = true),
29 | },
30 | }
31 |
--------------------------------------------------------------------------------
/packages/mapviewer/tests/cypress/fixtures/features/features.fixture.json:
--------------------------------------------------------------------------------
1 | {
2 | "results": [
3 | {
4 | "geometry": {
5 | "type": "MultiPoint",
6 | "coordinates": [[2600000.0, 1200000.0]]
7 | },
8 | "layerBodId": "test.wms.layer",
9 | "bbox": [2600000.0, 1200000.0, 2600000.0, 1200000.0],
10 | "featureId": 1234,
11 | "layerName": "WMS test layer",
12 | "type": "Feature",
13 | "id": 1234,
14 | "properties": {
15 | "label": "Feature 1234",
16 | "link_title": "Feature 1234 link title",
17 | "link_uri": "https://fake.link.feature_1234.ch",
18 | "link_2_title": null,
19 | "link_2_uri": null,
20 | "link_3_title": null,
21 | "link_3_uri": null,
22 | "x": 2600000.0,
23 | "y": 1200000.0,
24 | "lon": 7.43863,
25 | "lat": 46.95108
26 | }
27 | }
28 | ]
29 | }
30 |
--------------------------------------------------------------------------------
/packages/mapviewer/src/modules/menu/README.md:
--------------------------------------------------------------------------------
1 | # Menu module
2 |
3 | Adds a header bar on top of the screen that contains the search bar, and the language switch
4 |
5 | Adds a menu tray that can be opened on the side of the app, containing much of the controls the user has (layer list, drawing, print, etc...)
6 |
7 | Add a toolbox to the app that make possible to change the background, enables zooming, panning, and all other camera, position or zoom related values.
8 |
9 | Adds a search bar to the UI with all related UI elements (search results managements, etc...)
10 |
11 | ## Dependencies
12 |
13 | - Will import the lang switch button from the `i18n` module.
14 |
15 | ## State properties
16 |
17 | | Name | Content |
18 | | ---------------- | ------------------------------------------------------------------------ |
19 | | `search.query` | will trigger a search to the backend if it contains 3 or more characters |
20 | | `search.results` | results from the backend for the current search query |
21 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules
3 | dist/
4 | devServer/
5 |
6 | # local env files
7 | .env.local
8 | .env.*.local
9 |
10 | # Log files
11 | npm-debug.log*
12 | yarn-debug.log*
13 | yarn-error.log*
14 |
15 | # Editor directories and files
16 | .idea
17 | .vscode
18 | *.suo
19 | *.ntvs*
20 | *.njsproj
21 | *.sln
22 | *.sw?
23 | *.sublime-*
24 | *.code-*
25 |
26 | # vite
27 | vite.config.js.timestamp-*.mjs
28 |
29 | # Cypress and friends
30 | **/tests/cypress/downloads
31 | **/tests/cypress/videos
32 | **/tests/cypress/screenshots
33 | **/tests/results/*
34 |
35 | # Git
36 | *.orig
37 |
38 | # package-lock.json since we use pnpm
39 | package-lock.json
40 |
41 |
42 | **/scripts/check-layer-providers-results/*invalid_providers_cors.yaml
43 | **/scripts/check-layer-providers-results/*invalid_providers.yaml
44 | **/scripts/check-layer-providers-results/*invalid_providers_wms.yaml
45 | **/scripts/check-layer-providers-results/*invalid_providers_wmts.yaml
46 | **/scripts/check-layer-providers-results/*invalid_providers_content.yaml
47 | **/scripts/check-layer-providers-results/*valid_providers.json
48 |
--------------------------------------------------------------------------------
/packages/mapviewer/src/modules/menu/components/header/HeaderMenuButton.vue:
--------------------------------------------------------------------------------
1 |
18 |
19 |
20 |
29 |
30 |
31 |
41 |
--------------------------------------------------------------------------------
/packages/geoadmin-coordinates/src/proj/LV03CoordinateSystem.ts:
--------------------------------------------------------------------------------
1 | import CoordinateSystemBounds from '@/proj/CoordinateSystemBounds'
2 | import SwissCoordinateSystem from '@/proj/SwissCoordinateSystem'
3 |
4 | export default class LV03CoordinateSystem extends SwissCoordinateSystem {
5 | constructor() {
6 | super({
7 | epsgNumber: 21781,
8 | label: 'CH1903 / LV03',
9 | technicalName: 'LV03',
10 | // matrix is coming fom https://epsg.io/21781.proj4
11 | proj4transformationMatrix:
12 | '+proj=somerc +lat_0=46.9524055555556 +lon_0=7.43958333333333 +k_0=1 +x_0=600000 +y_0=200000 +ellps=bessel +towgs84=674.374,15.056,405.346,0,0,0,0 +units=m +no_defs +type=crs',
13 | // bound is coming from https://epsg.io/21781
14 | bounds: new CoordinateSystemBounds({
15 | lowerX: 485071.58,
16 | upperX: 837119.8,
17 | lowerY: 74261.72,
18 | upperY: 299941.79,
19 | }),
20 | usesMercatorPyramid: false,
21 | })
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/packages/mapviewer/tests/cypress/fixtures/geojson-style.fixture.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "unique",
3 | "property": "vorhersage-class",
4 | "values": [
5 | {
6 | "geomType": "point",
7 | "value": 0,
8 | "vectorOptions": {
9 | "type": "circle",
10 | "radius": 8,
11 | "fill": {
12 | "color": "#808080"
13 | },
14 | "stroke": {
15 | "color": "#FFFFFF",
16 | "width": 1
17 | }
18 | }
19 | },
20 | {
21 | "geomType": "point",
22 | "value": 1,
23 | "vectorOptions": {
24 | "type": "triangle",
25 | "radius": 12,
26 | "rotation": 1.0471975511965976,
27 | "fill": {
28 | "color": "#808080"
29 | },
30 | "stroke": {
31 | "color": "#FFFFFF",
32 | "width": 1
33 | }
34 | }
35 | }
36 | ]
37 | }
38 |
--------------------------------------------------------------------------------
/packages/geoadmin-elevation-profile/src/config.ts:
--------------------------------------------------------------------------------
1 | export const BASE_URL_PROD = 'https://api3.geo.admin.ch/'
2 | export const BASE_URL_INT = 'https://sys-api3.int.bgdi.ch/'
3 | export const BASE_URL_DEV = 'https://sys-api3.dev.bgdi.ch/'
4 |
5 | export type SupportedLocales = 'en' | 'de' | 'fr' | 'it' | 'rm'
6 | // mimicing values from https://github.com/geoadmin/web-mapviewer/blob/36043456b820b03f380804a63e2cac1a8a1850bc/packages/mapviewer/src/config/staging.config.js#L1-L7
7 | export type Staging = 'development' | 'integration' | 'production'
8 |
9 | export const BORDER_COLOR = 'rgb(255, 99, 132)'
10 | export const FILL_COLOR = 'rgba(255, 99, 132, 0.7)'
11 |
12 | /**
13 | * 12.5 meters is what was used in the old viewer, see
14 | * https://github.com/geoadmin/mf-geoadmin3/blob/ce24a27b0ca8192a0f78f7b8cc07f4e231031304/src/components/GeomUtilsService.js#L207
15 | *
16 | * I tried lowering the value, but with the test GPX that were attached to the ticket PB-800, I get
17 | * the worst hiking time estimation when using something like 5m than if I use this 12.5 meters.
18 | */
19 | export const GEOMETRY_SIMPLIFICATION_TOLERANCE = 12.5 // meters
20 |
--------------------------------------------------------------------------------
/packages/mapviewer/src/modules/drawing/components/DrawingMarkerInteraction.vue:
--------------------------------------------------------------------------------
1 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/tsconfig.shared.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "@vue/tsconfig/tsconfig.dom.json",
3 | "include": [
4 | "${configDir}/env.d.ts",
5 | "${configDir}/src/**/*.ts",
6 | "${configDir}/src/**/*.json",
7 | "${configDir}/src/**/*.vue"
8 | ],
9 | "exclude": ["${configDir}/src/**/__tests__/*"],
10 | "compilerOptions": {
11 | // see https://www.typescriptlang.org/docs/handbook/modules/guides/choosing-compiler-options.html#im-using-a-bundler
12 | "module": "ESNext",
13 | "moduleResolution": "bundler",
14 | "esModuleInterop": true,
15 | "lib": [
16 | "DOM",
17 | "ESNext.Array",
18 | "ESNext",
19 | "webworker"
20 | ],
21 |
22 | // see https://vite.dev/guide/features.html#typescript-compiler-options
23 | "isolatedModules": true,
24 | "useDefineForClassFields": true,
25 |
26 | "baseUrl": "${configDir}",
27 | "outDir": "${configDir}/dist",
28 | "paths": {
29 | "@/*": ["${configDir}/src/*"]
30 | },
31 | "typeRoots": ["node_modules/@types"]
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/packages/mapviewer/src/modules/map/components/footer/MapFooterAppCopyright.vue:
--------------------------------------------------------------------------------
1 |
24 |
25 |
26 |
33 | {{ t(link.label) }}
34 |
35 |
36 |
37 |
48 |
--------------------------------------------------------------------------------
/packages/mapviewer/src/modules/menu/components/debug/DebugViewSelector.vue:
--------------------------------------------------------------------------------
1 |
19 |
20 |
21 |
22 |
26 |
32 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/packages/mapviewer/src/scss/vue-transitions.mixin.scss:
--------------------------------------------------------------------------------
1 | @mixin fade-in-out($animation-time) {
2 | .fade-in-out-enter-active,
3 | .fade-in-out-leave-active {
4 | transition: opacity $animation-time;
5 | }
6 | .fade-in-out-enter-from,
7 | .fade-in-out-leave-to {
8 | opacity: 0;
9 | }
10 | }
11 |
12 | @mixin slide-up($animation-time) {
13 | .slide-up-leave-active,
14 | .slide-up-enter-active {
15 | transition: $animation-time;
16 | }
17 | .slide-up-enter-from,
18 | .slide-up-leave-to {
19 | transform: translate(0, -100%);
20 | }
21 | }
22 |
23 | @mixin slide-left($animation-time) {
24 | .slide-left-leave-active,
25 | .slide-left-enter-active {
26 | transition: $animation-time;
27 | }
28 | .slide-left-enter-from,
29 | .slide-left-leave-to {
30 | transform: translate(-100%, 0);
31 | }
32 | }
33 |
34 | @mixin slide-right($animation-time) {
35 | .slide-right-leave-active,
36 | .slide-right-enter-active {
37 | transition: $animation-time;
38 | }
39 | .slide-right-enter-from,
40 | .slide-right-leave-to {
41 | transform: translate(100%, 0);
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/adr/2022_05_09_mobile_click_behavior.md:
--------------------------------------------------------------------------------
1 | # Mobile click behavior
2 |
3 | > Status: accepted
4 |
5 | > Date: 06.07.2022
6 |
7 | ## Context
8 |
9 | Currently, a short click will switch the app in fullscreen mode. A long click (with a release of the click) will run an identify (like a click on desktop)
10 |
11 | The issue is that there is no location popup possibilities with that (or at least it's unwanted if it pops up after a long click). We need to rework that.
12 |
13 | ## Decision
14 |
15 | - Mobile layout (menu must be opened through header button)
16 | - Single touch (click) : identify, if no feature found, fullscreen toggle
17 | - Long touch : location popup
18 | - Desktop layout (menu always open)
19 | - Single click : identify (no fullscreen toggle)
20 | - Long click : nothing
21 | - Right click : location popup
22 |
23 | ## Consequences
24 |
25 | This would allow mobile users to use all the features we provide (identify, location) while keeping the fullscreen possibility.
26 |
27 | ## Links
28 |
29 | - [JIRA ticket this ADR is based on](https://jira.swisstopo.ch/browse/BGDIINF_SB-2235)
30 | - [JIRA ticket where this became a problem](https://jira.swisstopo.ch/browse/BGDIINF_SB-2323)
31 |
--------------------------------------------------------------------------------
/packages/geoadmin-log/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@geoadmin/log",
3 | "version": "0.0.1",
4 | "description": "Logging utils for geoadmin",
5 | "type": "module",
6 | "exports": {
7 | ".": {
8 | "types": "./dist/index.d.ts",
9 | "import": "./dist/index.js",
10 | "require": "./dist/index.umd.cjs"
11 | },
12 | "./Message": {
13 | "types": "./dist/Message.d.ts",
14 | "import": "./dist/Message.js",
15 | "require": "./dist/Message.umd.js"
16 | }
17 | },
18 | "files": [
19 | "dist"
20 | ],
21 | "scripts": {
22 | "build": "pnpm run type-check && pnpm run generate-types && vite build",
23 | "build:dev": "pnpm run build --mode development",
24 | "build:dev:watch": "pnpm run build --watch --mode development",
25 | "build:int": "pnpm run build --mode integration",
26 | "build:prod": "pnpm run build --mode production",
27 | "dev": "vite",
28 | "generate-types": "vue-tsc --declaration",
29 | "type-check": "vue-tsc -p tsconfig.json"
30 | },
31 | "peerDependencies": {
32 | "proj4": "catalog:"
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/packages/mapviewer/src/utils/EventEmitter.class.js:
--------------------------------------------------------------------------------
1 | // from https://gist.github.com/mudge/5830382#gistcomment-2691957
2 | /** Enables an instance of a class to emit its own events (and be listened to) */
3 | export default class EventEmitter {
4 | constructor() {
5 | this.events = {}
6 | }
7 |
8 | _getEventListByName(eventName) {
9 | if (typeof this.events[eventName] === 'undefined') {
10 | this.events[eventName] = new Set()
11 | }
12 | return this.events[eventName]
13 | }
14 |
15 | on(eventName, fn) {
16 | this._getEventListByName(eventName).add(fn)
17 | }
18 |
19 | once(eventName, fn) {
20 | const onceFn = (...args) => {
21 | this.removeListener(eventName, onceFn)
22 | fn?.apply(this, args)
23 | }
24 | this.on(eventName, onceFn)
25 | }
26 |
27 | emit(eventName, ...args) {
28 | this._getEventListByName(eventName).forEach(
29 | function (fn) {
30 | fn?.apply(this, args)
31 | }.bind(this)
32 | )
33 | }
34 |
35 | removeListener(eventName, fn) {
36 | this._getEventListByName(eventName).delete(fn)
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/packages/mapviewer/src/store/plugins/screen-size-management.plugin.js:
--------------------------------------------------------------------------------
1 | import { BREAKPOINT_PHONE_HEIGHT, BREAKPOINT_PHONE_WIDTH } from '@/config/responsive.config'
2 | import { UIModes } from '@/store/modules/ui.store'
3 |
4 | const dispatcher = { dispatcher: 'screen-size-management.plugin' }
5 |
6 | /** @param store */
7 | const screenSizeManagementPlugin = (store) => {
8 | store.subscribe((mutation, state) => {
9 | if (mutation.type === 'setSize') {
10 | // listening to screen size change to decide if we should switch UI mode too
11 | let wantedUiMode
12 | if (
13 | state.ui.width < BREAKPOINT_PHONE_WIDTH ||
14 | state.ui.height < BREAKPOINT_PHONE_HEIGHT
15 | ) {
16 | wantedUiMode = UIModes.PHONE
17 | } else {
18 | // so the UI mode DESKTOP also includes the tablet mode.
19 | wantedUiMode = UIModes.DESKTOP
20 | }
21 | if (wantedUiMode !== state.ui.mode) {
22 | store.dispatch('setUiMode', { mode: wantedUiMode, ...dispatcher })
23 | }
24 | }
25 | })
26 | }
27 |
28 | export default screenSizeManagementPlugin
29 |
--------------------------------------------------------------------------------
/packages/mapviewer/src/utils/components/BlackBackdrop.vue:
--------------------------------------------------------------------------------
1 |
15 |
16 |
17 |
22 |
26 |
31 |
32 |
33 |
34 |
35 |
45 |
--------------------------------------------------------------------------------
/packages/mapviewer/tests/cypress/support/e2e.js:
--------------------------------------------------------------------------------
1 | // ***********************************************************
2 | // This example support/command.js is processed and
3 | // loaded automatically before your test files.
4 | //
5 | // This is a great place to put global configuration and
6 | // behavior that modifies Cypress.
7 | //
8 | // You can change the location of this file or turn off
9 | // automatically serving support files with the
10 | // 'supportFile' configuration option.
11 | //
12 | // You can read more here:
13 | // https://on.cypress.io/configuration
14 | // ***********************************************************
15 |
16 | // Import commands.js using ES2015 syntax:
17 | import './commands'
18 | import './drawing'
19 |
20 | // Alternatively you can use CommonJS syntax:
21 | // require('./commands')
22 |
23 | Cypress.on('uncaught:exception', (err, runnable) => {
24 | Cypress.log({
25 | name: 'Uncaught error!',
26 | message: err.message,
27 | consoleProps() {
28 | return {
29 | err,
30 | runnable,
31 | }
32 | },
33 | })
34 | // returning false here prevents Cypress from failing the test
35 | return false
36 | })
37 |
--------------------------------------------------------------------------------
/stylelint.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | extends: [
3 | "stylelint-config-recommended-vue",
4 | "stylelint-config-recommended-scss"
5 | ],
6 | plugins: ["stylelint-scss", "stylelint-order"],
7 | overrides: [
8 | {
9 | files: ["**/*.vue"],
10 | customSyntax: "postcss-html"
11 | }
12 | ],
13 | rules: {
14 | "no-duplicate-selectors": null, // Deactivating rule to allow duplicate selectors to follow the new sass expected bahaviour https://sass-lang.com/documentation/at-rules/mixin/
15 | "property-no-unknown": [true, { // Deactivating rule to allow unknown properties in :export selectors
16 | "ignoreSelectors": [":export"]
17 | }],
18 | "declaration-property-value-no-unknown": [true, {
19 | "ignoreProperties": {
20 | "/.+/": "/$/", // ignore variables with a $ (i have not found a way to make it work only if the $ is at the beginning since "/^\\$/" does not work at all)
21 | }
22 | }],
23 | "selector-pseudo-class-no-unknown": [ // Deactivating rule to allow pseudo classes like :global
24 | true,
25 | {
26 | "ignorePseudoClasses": [
27 | "global",
28 | "export",
29 | "deep",
30 | ]
31 | }
32 | ],
33 | }
34 | };
--------------------------------------------------------------------------------
/packages/mapviewer/tests/cypress/fixtures/print/old-geoadmin-label.kml:
--------------------------------------------------------------------------------
1 | DrawingmarkerOld Label1clampToGround8.161491779847474,46.97804233732786
19 |
--------------------------------------------------------------------------------
/.github/workflows/add-testlink-to-pr.yml:
--------------------------------------------------------------------------------
1 | name: Create test link on PR creation
2 | on:
3 | pull_request:
4 | types:
5 | - opened
6 | - reopened
7 | - synchronize
8 | - edited
9 | jobs:
10 | update_pr:
11 | runs-on: ubuntu-latest
12 | steps:
13 | - name: Create/update test link on DEV
14 | if: ${{ github.base_ref != 'master' }}
15 | uses: tzkhan/pr-update-action@v2
16 | with:
17 | repo-token: "${{ secrets.GITHUB_TOKEN }}"
18 | head-branch-regex: '.+'
19 | body-template: |
20 |
21 | [Test link](https://sys-map.dev.bgdi.ch/preview/%headbranch%/index.html)
22 | body-update-action: 'suffix'
23 | body-uppercase-head-match: false
24 |
25 | - name: Create/update deployment link on INT
26 | if: ${{ github.base_ref == 'master' }}
27 | uses: tzkhan/pr-update-action@v2
28 | with:
29 | repo-token: "${{ secrets.GITHUB_TOKEN }}"
30 | head-branch-regex: '.+'
31 | body-template: |
32 |
33 | [Test link](https://sys-map.int.bgdi.ch/preview/%headbranch%/index.html)
34 | body-update-action: 'suffix'
35 | body-uppercase-head-match: false
36 |
--------------------------------------------------------------------------------
/packages/mapviewer/src/modules/map/README.md:
--------------------------------------------------------------------------------
1 | # Map module
2 |
3 | Responsible for rendering the map according to the state, handles click on the map and acts accordingly (making API call to the backend for identify, or drawing)
4 |
5 | ## State properties
6 |
7 | | Name | Content |
8 | | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
9 | | `map.isBeingDragged` | `true` when the underlying map experiences a drag event from the mouse, goes back to `false` as soon as the interaction ends (doesn't trigger `true` on a click, only on drag events) |
10 | | `map.clickInfo` | Information about the last click that has occurred on the map, including how long the click was |
11 | | `map.pinnedLocation` | Coordinate for a dropped pin on the map (only one at a time) |
12 |
--------------------------------------------------------------------------------
/packages/mapviewer/tests/cypress/fixtures/print/label.kml:
--------------------------------------------------------------------------------
1 | DrawingSample Label0,-44.75marker7.629431833399272,47.0431253777804
19 |
--------------------------------------------------------------------------------
/packages/mapviewer/src/utils/__tests__/kml_feature_error.kml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 1
6 | 1
7 | GPS Visualizer]]>
8 |
9 | Tracks
10 | 1
11 | 0
12 |
13 |
14 |
15 |
16 |
22 |
23 | 1
24 | clampToGround
25 | 8.511875,47.35233
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/packages/mapviewer/src/modules/menu/components/help/HelpLink.vue:
--------------------------------------------------------------------------------
1 |
37 |
38 |
39 |
43 | {{ t('help_label') }}
44 |
45 |
46 |
--------------------------------------------------------------------------------
/packages/mapviewer/tests/cypress/fixtures/import-tool/kml_feature_error.kml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 1
6 | 1
7 | GPS Visualizer]]>
8 |
9 | Tracks
10 | 1
11 | 0
12 |
13 |
14 |
15 |
16 |
22 |
23 | 1
24 | clampToGround
25 | 8.511875,47.35233
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/packages/mapviewer/src/modules/menu/components/header/SwissFlag.vue:
--------------------------------------------------------------------------------
1 |
19 |
20 |
21 | emits('click', e)"
27 | />
28 |
29 |
30 |
53 |
--------------------------------------------------------------------------------
/packages/mapviewer/src/modules/map/components/cesium/CesiumVectorLayer.vue:
--------------------------------------------------------------------------------
1 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/packages/mapviewer/src/modules/menu/components/header/HeaderLangSelector.vue:
--------------------------------------------------------------------------------
1 |
21 |
22 |
23 |
24 |
31 | {{ lang.toUpperCase() }}
32 |
33 |
34 |
35 |
36 |
46 |
--------------------------------------------------------------------------------
/adr/2022_04_11_vuex_store_consolidation.md:
--------------------------------------------------------------------------------
1 | # Vuex store consolidation
2 |
3 | > Status: accepted
4 |
5 | > Date: 11.04.2022
6 |
7 | ## Context
8 |
9 | The project started with a fragemented store. The main store was itself treated like the modules that contain the components. Some of those in turn contained store modules for their state.
10 |
11 | The idea was to encapsulate each part of the application as much as possible to allow for a later externalization. But, with an intertwined application like a map viewer where much of the state is shared anyway this form of modularization doesn't bring much benefit while making it harder for a developer to find something in the store.
12 |
13 | Consequently, most store modules are already shared and only a few remain distributed among the components.
14 |
15 | ## Decision
16 |
17 | To make it easier to work with the store we decided to consolidate the store on the top-level of the `src` directory.
18 |
19 | ## Consequences
20 |
21 | With this change all the state is in one place which makes it much easier to navigate the store.
22 |
23 | Having all store modules in one directory encourages to split the store according to the content and not the consuming components. But, it allows for both.
24 |
25 | A consolidated store makes it harder to externalize modules later but this is mostly perception as the code was already interdependant before the structural change.
26 |
--------------------------------------------------------------------------------
/packages/geoadmin-numbers/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@geoadmin/numbers",
3 | "version": "0.0.1",
4 | "description": "Numbers utils for geoadmin",
5 | "type": "module",
6 | "exports": {
7 | ".": {
8 | "types": "./dist/index.d.ts",
9 | "import": "./dist/index.js",
10 | "require": "./dist/index.umd.cjs"
11 | }
12 | },
13 | "files": [
14 | "dist"
15 | ],
16 | "scripts": {
17 | "build": "pnpm run type-check && pnpm run generate-types && vite build",
18 | "build:dev": "pnpm run build -- --mode development",
19 | "build:dev:watch": "pnpm run build --watch -- --mode development",
20 | "build:int": "pnpm run build -- --mode integration",
21 | "build:prod": "pnpm run build -- --mode production",
22 | "dev": "vite",
23 | "generate-types": "vue-tsc --declaration",
24 | "test:unit": "vitest --run --mode development --environment jsdom",
25 | "test:unit:watch": "vitest --mode development --environment jsdom",
26 | "type-check": "vue-tsc -p tsconfig.json"
27 | },
28 | "dependencies": {
29 | "@geoadmin/log": "workspace:*"
30 | },
31 | "devDependencies": {
32 | "chai": "catalog:",
33 | "vite": "catalog:",
34 | "vite-plugin-dts": "catalog:",
35 | "vitest": "catalog:",
36 | "vue-tsc": "catalog:"
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/packages/mapviewer/src/config/responsive.config.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Horizontal threshold for the phone view. (min-width for tablet) This will change the menu and
3 | * also some interactions.
4 | *
5 | * The value is taken from the "sm" breakpoint from Bootstrap. If this value is modified, the
6 | * variable with the same name defined in 'src/scss/media-query.mixin' must also be modified.
7 | *
8 | * @type {Number}
9 | */
10 | export const BREAKPOINT_PHONE_WIDTH = 576
11 |
12 | /**
13 | * Horizontal threshold for the phone view. (min-height for tablet) The height is needed to catch
14 | * landscape view on mobile.
15 | *
16 | * If this value is modified, the variable with the same name defined in
17 | * 'src/scss/media-query.mixin' must also be modified.
18 | *
19 | * @type {Number}
20 | */
21 | export const BREAKPOINT_PHONE_HEIGHT = 500
22 |
23 | /**
24 | * Horizontal threshold for the tablet view. (min-width for desktop)
25 | *
26 | * If this value is modified, the variable with the same name defined in
27 | * 'src/scss/media-query.mixin' must also be modified.
28 | *
29 | * @type {Number}
30 | */
31 | export const BREAKPOINT_TABLET = 768
32 |
33 | /**
34 | * The width under which we no longer use floating tooltips and enforce infoboxes.
35 | *
36 | * Found empirically, taking the tooltip width of 350px into account
37 | *
38 | * @type {Number}
39 | */
40 | export const MAX_WIDTH_SHOW_FLOATING_TOOLTIP = 400
41 |
--------------------------------------------------------------------------------
/packages/mapviewer/src/modules/menu/components/help/common/SendActionButtons.vue:
--------------------------------------------------------------------------------
1 |
27 |
28 |
29 |