Skip to content

Commit

Permalink
Merge pull request #94 from AISViz/merge-functions
Browse files Browse the repository at this point in the history
Merge functions
  • Loading branch information
Jinnkunn authored Sep 13, 2024
2 parents 92a594f + aad8edc commit ed96c7e
Show file tree
Hide file tree
Showing 33 changed files with 7,716 additions and 0 deletions.
60 changes: 60 additions & 0 deletions aisdb_web/build_website.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/bin/bash
SCRIPTPATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
ROOTDIR="${SCRIPTPATH}/.."
PKGDIR="${ROOTDIR}/aisdb"
RSTSOURCEDIR="${ROOTDIR}/docs/source"
MAPDIR="${ROOTDIR}/aisdb_web/map"
SPHINXDIR="${ROOTDIR}/docs/dist_sphinx"
WASMDIR="${ROOTDIR}/client_webassembly"

set -e

# jsdocs site build
#JSDOCDIR="${ROOTDIR}/aisdb_web/dist_jsdoc"
#cd "${SCRIPTPATH}"
#npx jsdoc \
# --recurse "${MAPDIR}" \
# --package "${ROOTDIR}/aisdb_web/package.json" \
# --destination "${JSDOCDIR}"



# webassembly components build for map
#[[ ! -f "$HOME/.cargo/bin/wasm-pack" ]] && echo "installing wasm-pack..." && curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
cd "${WASMDIR}"
if declare -p DEBUG ; then
echo 'building with profile dev ...'
wasm-pack build --target web --out-dir "${MAPDIR}/pkg" --dev
else
echo 'building with profile release ...'
wasm-pack build --target web --out-dir "${MAPDIR}/pkg" --release
fi
wasm-opt -O3 -o "${MAPDIR}/pkg/client_bg.wasm" "${MAPDIR}/pkg/client_bg.wasm"
#wasm-pack build --target web --out-dir "${MAPDIR}/pkg" --dev


# build map webapp
cd "${MAPDIR}"
npm --prefix "${ROOTDIR}/aisdb_web" install
#VITE_AISDBHOST=$AISDBHOST \
#VITE_AISDBPORT=$AISDBPORT \
#VITE_BINGMAPTILES=$VITE_BINGMAPTILES \
#VITE_TILESERVER=$VITE_TILESERVER \

#VITE_BINGMAPTILES=\
#VITE_TILESERVER=\
VITE_DISABLE_SSL_DB=1 \
VITE_DISABLE_STREAM=1 \
VITE_AISDBHOST=localhost \
VITE_AISDBPORT=9924 \
npx vite build --outDir "${MAPDIR}/../dist_map"
#zip -ru9 aisdb_web/dist_map.zip aisdb_web/dist_map/

VITE_BINGMAPTILES=1 \
VITE_TILESERVER=aisdb.meridian.cs.dal.ca \
VITE_DISABLE_SSL_DB=1 \
VITE_DISABLE_STREAM=1 \
VITE_AISDBHOST=localhost \
VITE_AISDBPORT=9924 \
npx vite build --outDir "${MAPDIR}/../dist_map_bingmaps"
#zip -ru9 aisdb_web/dist_map_bingmaps.zip aisdb_web/dist_map_bingmaps/
32 changes: 32 additions & 0 deletions aisdb_web/map/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import 'ol/ol.css';

window.addEventListener('load', async () => {
const [
{ init_maplayers },
{ initialize_db_socket },
{ initialize_selectform },
//{ initialize_stream_socket },
{ default: parseUrl },
{ disable_stream },
//{ },
] = await Promise.all([
import('./map.js'),
import('./clientsocket.js'),
import('./selectform.js'),
import('./url.js'),
import('./vessel_metadata.ts'),
import('./constants.js'),
]);

await Promise.all([
init_maplayers(),
initialize_db_socket(),
initialize_selectform(),
]);
await parseUrl();

if (disable_stream !== null && disable_stream !== undefined) {
let { initialize_stream_socket } = await import('./livestream.js');
await initialize_stream_socket();
}
});
Loading

0 comments on commit ed96c7e

Please sign in to comment.