@opengeoweb/taf
v14.4.0
Published
GeoWeb TAF library for the opengeoweb project
Downloads
612
Keywords
Readme
Taf
React component library with Taf components for the opengeoweb project. This library was generated with Nx.
Installation
npm install @opengeoweb/tafAPI
The front-end uses the axios library to fetch data from the api. Importing components from the Taf repository should be wrapped by the ApiProvider component with a specified baseURL. Example:
import { ApiProvider } from '@opengeoweb/api';
import { TafModule } from '@opengeoweb/taf';
const myAuth = {
username: 'string',
token: 'string',
refresh_token: 'string',
};
const Component = () => {
const [auth, onSetAuth] = React.useState(myAuth);
return (
<ApiProvider
baseURL="http://test.com"
appURL="http://app.com"
auth={auth}
onSetAuth={onSetAuth}
createApi={createApi}
authTokenURL="url/tokenrefresh"
>
<TafModule />
</ApiProvider>
)}Configuration
The TAF configuration is fetched from the TAF backend via the /taf-config endpoint.
AutoTaf
Enable AutoTaf module in the geoweb application
To use AutoTaf in the geoweb application, add the following config key in config.json:
"GW_FEATURE_TAF_AUTOTAF_ENABLED": true
Configure autoTaf locations in TAF configuration
To configure the expected AutoTaf locations, add a list of AutoTaf locations in the TAF configuration:
"autoTAFlocations": ["EHAM", "EHRD", "EHLE", "EHGG", "EHBK"]
