A TerriaJS plugin that adds a Search Parcel button to your map. It opens a modal, queries GeoServer WFS using a CQL filter on PRCL_KEY, adds the results as an in-memory GeoJSON catalog item, and auto-zooms to the result.
# in the plugin folder
yarn install
yarn build-
At your TerriaMap root:
yarn add file:../terriajs-plugin-parcel-search
-
Edit
plugins.ts(TerriaMap root) to load the plugin:import type { TerriaPluginModule } from "terriajs-plugin-api"; const plugins: () => Promise<TerriaPluginModule>[] = () => [ () => import("terriajs-plugin-parcel-search") ]; export default plugins;
-
Run TerriaMap:
yarn && yarn gulp dev
You should see a 🔎 Search Parcel button in the top-right. Enter a PRCL_KEY, and the map will auto-zoom to matching features.
If your GeoServer is on another origin, enable CORS or add it to
parameters.proxyDomainsinwwwroot/config.json.
Open src/SearchParcelTool.tsx and set:
const WFS_URL = "http://localhost:8080/geoserver/farm_solution/ows";
const TYPE_NAME = "farm_solution:mv_gauteng";
const KEY_FIELD = "PRCL_KEY";yarn watchThis will rebuild to dist/ on changes.