How oac-tw/oac-spa works
Main components of the system
• Frontend Application – This is mainly implemented under “src”. It includes:
– The main Vue.js application (src/main.js) that bootstraps the UI.
– A series of Vue components (under src/components) covering the UI elements for maps (mapUI, mapUIxs), layers (layer, layerBaseMap, layerLegend, etc.), search functionality, filtering, and additional interactive parts.
– Styling (custom.scss, element-variables.scss) for theming and layout.
• State Management – Vuex is used (src/store.js plus separate state files such as layerState.js and resultState.js) to manage the application’s state across UI components.
• & Layer Management – This is a central area of the application where the following reside:
– Configuration files (public/layerDef.json, public/layerCatelog.json, public/layerLegend.json, public/layerTag.json) define layer behaviors, definitions, and legends.
– Leaflet-based mapping logic and extensions, implemented in both JavaScript (src) and TypeScript (typescript folder). The TypeScript modules extend Leaflet’s capabilities by including various layer types (e.g., geojsonLayer, gradientLayer, typhoonLayer, velocity layers, etc.).
• PWA and Deployment Components – The project uses a service worker (src/sw.js, src/sw-manifest.js) configured with workbox, as well as deployment scripts (deploy.js, with MSDeploy configuration guidelines in IIS_config.md) and webpack or babel configurations (vue.config.js, babel.config.js) that tailor the build for production.
Out relationships and interactions
• The Vue frontend interacts with the state management layer (Vuex) which in turn coordinates data and visibility settings for various mapping components.
• The mapping modules (both in Vue components and in the TypeScript layer modules) fetch configuration details from the public JSON files to initialize base layers, overlays, and legends.
• The service worker and PWA integration (configured through workbox and manifest-related settings) handle caching and offline accessibility: a key aspect that touches the loading of map tiles and assets.
• Deployment and build processes (e.g., npm run serve, npm run build, npm run deploy) are orchestrated via the provided configuration files, deploy.js, and package.json scripts, showing a separation between development and production pipelines.
Significant architectural patterns/design principles
• Component-based UI: The project is broken down into modular Vue components that manage discrete UI elements.
• State-driven Architecture: Vuex is set up to modularize state (layer, result, etc.) ensuring that global application state is maintained in an organized way.
• Separation of Concerns: The system cleanly separates presentation (Vue components), state (Vuex), business logic (map and layer modules in both JS and TypeScript), and configuration (JSON files in public).
• Progressive Enhancement: The use of PWA techniques via service workers and Workbox to improve performance and offline availability.
• Extensibility: The TypeScript directory demonstrates a modular and extensible approach to extending Leaflet’s functionality for several kinds of dynamic layers.
Relevant technologies and frameworks
• Vue.js and Vuex for the front-end UI and state management.
• Leaflet with extended TypeScript modules for mapping and geospatial visualizations.
• Workbox, service workers, and PWA-related technologies for caching and offline support.
• Webpack configurations (via vue.config.js, babel.config.js) to drive the build/deployment process.
• MSDeploy for deployment (with details in IIS_config.md and deploy.js).