
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
terriajs-plugin-sample
Advanced tools
This repository implements a sample TerriaJS plugin. The plugin implements a custom tool for drawin an interactive 3D box on the map. It serves as an example for setting up an loading an external plugin library that adds some new functionality to Terria without forking it.
Plugins allow extending Terria in two ways:
This plugin code utilizes these additional peer dependencies from the TerriaJS library and are pre-requisites for understanding the code:
Additional documentation for developing with terria is available at https://docs.terria.io/. You can also reach us through our discussion forum if you require additional help.
This plugin repository is a work in progress and will be updated as the plugin interfaces evolve. Meanwhile expect breaking changes.
git clone https://github.com/terriajs/terriamap
cd terriamap
yarn add -W 'terriajs-plugin-sample'
plugins.ts
const plugins: any[] = [
import("terriajs-plugin-sample")
];
...
export default plugins;
Note: The file plugins.ts
is in the terriamap project root directory.
# From the terriamap directory run
yarn run gulp dev
Once the server is running visit http://localhost:3001 to load the app. You should see a new plugin button added to the map toolbar on the right hand side. Opening the tool will prompt the user to draw a rectangle on the map, this will place a 3d box of the same dimension on the map. Screenshot of the plugin in action:
Developing the plugin requires correctly setting up the yarn workspace. Your local directory structure should look something like:
terriamap/
packages/
├── plugin-sample
└── terriajs
The terriajs
and plugin-sample
repositories must be checked out under terriamap/packages/
folder
cd terriamap/
mkdir -p packages
git clone https://github.com/terriajs/terriajs packages/terriajs
git clone https://github.com/terriajs/plugin-sample packages/plugin-sample
package.json
file.Edit package.json
for terriamap:
{
"private": true,
"workspaces": {
"packages": [
"packages/terriajs",
"packages/cesium",
"packages/terriajs-server"
"packages/plugin-sample" // <-- plugin-sample added here
],
...
"dependencies": {
"terriajs-plugin-api": "0.0.1-alpha.16",
"terriajs-plugin-sample": "0.0.1-alpha.8", // <-- plugin-sample version should match the version in packages/plugin-sample/package.json
From your terriamap
folder run:
yarn install
# Starts a terriamap build process that watches for file changes
yarn run gulp watch
cd terriamap/packages/plugin-sample
# Start a plugin build process that watches for file changes
yarn run watch
Start making make changes to the plugin code, terriamap will automatically rebuild the changes. Note that the page doesn't reload automatically, so you will need to refresh to see the changes.
FAQs
A sample terriajs plugin.
The npm package terriajs-plugin-sample receives a total of 139 weekly downloads. As such, terriajs-plugin-sample popularity was classified as not popular.
We found that terriajs-plugin-sample demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.