ArAssetsV2
Files & Folders
- node_modules/*
Contains the nessecary libraries. Changed only vianpm - types/*
Contains typescript definitions (".d.ts") for JS libraries that have not been properly ported to TS yet - tmp/*
Contains transpiled code. Useless without browserifying it. Gets deleted automatically after build - src/*
Contains the typescript source files - www/
- img/
Contains images like map markers etc. - map/*.jpg
Leaflet map overlays - map/overlays.json Contains list of leaflet map overlays with name and bounding coordinates
- leaflet.css
Leaflet stylesheet - main.js
Final transpiled and browserified code - style.css
Stylesheet for - index.html
Main page of the app. Also the only page though.
- img/
- package*.json
NodeJs stuff. Contains library dependencies and so on. Only changed vianpm - tsconfig.json
Typescript project configuration - build
Shell script that compiles the app once. Usage:./build - watch
Shell script to automatically recompile when chaged. Usage:./watch - readme.md
This
Comment on loading map overlays
The solution for loading a sort of config file for map image overlays is as ugly as it is because Firefox and other browsers block CORS HTTP requests by default for security reasons, thats why I changed from loading a json file via HTTP to dynamically including a javascript file which hangs the "config" onto the global window object to be read from there. This was the only way I could think of without running the whole application on an actual webserver. Sorry future dev
Building/Watching
| Dependency | install via |
|---|---|
| Typescript compiler | npm i -g tsc |
Browserify (for ./build) |
npm i -g browserify |
Uglify (for --min) |
npm i -g uglify-es |
Watchify (for ./watch) |
npm i -g watchify |
build
The build script will transpile (.ts -> .js) and browserify (resolve dependencies) automatically. It also has two command line arguments:
--minwill minify the output file--fetch-depswill (re)install all node modules