Skip to content

ZoloKiala/terriajs-plugin-parcel-search

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

terriajs-plugin-parcel-search

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.

Install (as a local package)

# in the plugin folder
yarn install
yarn build

Wire into TerriaMap

  1. At your TerriaMap root:

    yarn add file:../terriajs-plugin-parcel-search
  2. 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;
  3. 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.proxyDomains in wwwroot/config.json.

Configure

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";

Dev

yarn watch

This will rebuild to dist/ on changes.

terriajs-plugin-parcel-search

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors