This repo implements a Single Dataset Spatial Query plugin, to support extension of the core tools available within the Digital Twin Victoria.
The plugin uses the experimental terriajs-plugin-api to interface with the TerriaJS library. Plugins are integrated within a TerriaMap based application through the plugins.ts importer.
We currently suggest using yarn workspaces to develop plugins for terriamap. Follow these steps to to setup a yarn workspace for this plugin:
git clone https://github.com/terriajs/terriamap
cd terriamap
git checkout plugins # checkout plugins branch (Temporary step until changes merged to main branch)
mkdir -p packages
cd packages
git clone https://github.com/geoplex/terriajs-spatial-query-pluginAdd the plugin package to the yarn workspace settings of your terriamap package.json file.
Edit package.json for terriamap:
{
"private": true,
"workspaces": {
"packages": [
"packages/terriajs",
"packages/cesium",
"packages/terriajs-server"
"packages/terriajs-spatial-query-plugin" // <-- plugin added here
],
...
"dependencies": {
"pm2": "^3.2.2",
"terriajs-plugin-api": "0.0.1-alpha.1",
"terriajs-spatial-query-plugin": "0.1.0", // <-- plugin version changed to match the version in plugin package.jsoncd terriamap
yarn install
# Starts a terriamap build process that watches for file changes
yarn run gulp watch cd terriamap/packages/terriajs-spatial-query-plugin
# Start a plugin build process that watches for file changes
yarn watch# Build the plugin
yarn build# Format Code with Prettier
yarn format# Run Linter
yarn lint# Run Linter and Automatically Fix Issues
yarn lint-fix# Run Tests
yarn test