diff --git a/package.json b/package.json index 2971300be..cf61ec5db 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "buildPages": "rimraf ./pages_output && bash ./scripts/buildPages.sh", "clean": "lerna clean && rimraf --glob packages/**/{.cache,dist,docs} && rimraf --glob {.cache,dist,pages_output} && node ./scripts/clean", "docs:afm": "node ./scripts/makeDocs ./packages/clients/afm", + "docs:meldemichel": "node ./scripts/makeDocs ./packages/clients/meldemichel && npm run meldemichel:build && cp -r ./packages/clients/meldemichel/dist ./packages/clients/meldemichel/example ./packages/clients/meldemichel/docs", "docs:sbom": "npx @cyclonedx/cyclonedx-npm --output-file sbom.json", "docs:snowbox": "node ./scripts/makeDocs ./packages/clients/snowbox", "lint": "npx eslint . --cache --ext .js,.ts,.vue", diff --git a/packages/clients/meldemichel/API.md b/packages/clients/meldemichel/API.md index 8889447a9..550cdcd4c 100644 --- a/packages/clients/meldemichel/API.md +++ b/packages/clients/meldemichel/API.md @@ -1,20 +1,24 @@ # Meldemichel MapClient API 🗺️ `@polar/client-meldemichel` -This client is based on [POLAR](example.com/TODO) and subsequently the [masterportalAPI](https://bitbucket.org/geowerkstatt-hamburg/masterportalapi/src/master/). Please check the [common POLAR documentation](example.com/TODO) for details. The following documentation only contains how this specific client can be used, and the minimal information required to get it running. +This client is based on [POLAR](https://github.com/Dataport/polar) and subsequently the [masterportalAPI](https://bitbucket.org/geowerkstatt-hamburg/masterportalapi/src/master/). The following documentation only contains how this specific client can be used, and the minimal information required to get it running. + +For all additional details, check the [full documentation](https://dataport.github.io/polar/docs/meldemichel/client-meldemichel.html). + +For the development test deployments, [see here](./example/index.html). ## Basic usage -The NPM package `@polar/client-meldemichel` can be installed via NPM. When using `import mapClient from '@polar/client-meldemichel'`, the object `mapClient` contains a method `createMap`. This is the main method required to get the client up and running. Should you use another import method, check the package's `dist` folder for available files. +The NPM package `@polar/client-meldemichel` can be installed via NPM or downloaded from the [release page](https://github.com/Dataport/polar/releases). When using `import mapClient from '@polar/client-meldemichel'`, the object `mapClient` contains a method `createMap`. This is the main method required to get the client up and running. Should you use another import method, check the package's `dist` folder for available files. The method expects a single object with the following parameters. | fieldName | type | description | | --------------- | ------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | containerId | string | ID of the container the map is supposed to render itself to. | -| mode | enum["COMPLETE", "SINGLE", "REPORT"] | See chapters below for an overview of the modes. | -| afmUrl | string? | COMPLETE mode only. URL used in the AfM Button. | -| reportServiceId | string? | COMPLETE mode only. ID of the report layer to display. | -| configOverride | object? | You will probably not need this object. It is included to override any internal configuration, should the need for quick reconfiguration arise. Please refer to the general documentation on what can be done here. If you need it, please communicate back with us what the issue was. | +| mode | enum["REPORT", "SINGLE", "COMPLETE"] | See chapters below for an overview of the modes. | +| afmUrl | string? | TODO `COMPLETE` mode only. URL used in the AfM Button. | +| reportServiceId | string? | TODO `COMPLETE` mode only. ID of the report layer to display. | +| configOverride | object? | This can be used to override the configuration of any installed plugin; see full documentation. It is also used to set initial pins in `SINGLE` mode. See documentation of `SINGLE` further below. | It returns a Promise of a map instance. This returned instance is required to retrieve information from the map. @@ -24,29 +28,7 @@ The package also includes a `style.css` and an `index.html` file. The `style.css ``` -The `index.html` is used in COMPLETE mode, which is not run in the AfM. You may, however, use it for testing. - -## Rendering COMPLETE mode - -The `index.html` included in the package's `dist` folder has been prepared for this mode and must merely be hosted. - -// TODO translate after implementation (details might change) - -Dieser [AfMButton] wird dann gerendert, wenn in der mapConf das Feld `afmUrl` befüllt ist, zum Beispiel mit dem String `"https://afm.hamburg.de/intelliform/forms/mml_melde_michel/standard/mml_melde_michel/index"`. Diese URL ist in die Konfiguration gezogen worden, falls sich die Adresse des Prozesses einmal ändern sollte. - -Der URL werden folgende Query-Parameter (hier mit Beispielwerten) hinzugefügt: - -- `mapCenter=569029.708,5932888.959` -- `mapZoomLevel=9` -- `mapBaseLayer=452` - - Wert ist ID in der https://geoportal-hamburg.de/lgv-config/services-internet.json -- `vendor_maps_position=569029.708,5932888.959` -- `vendor_maps_address_str=Berlinertordamm` -- `vendor_maps_address_hnr=4` -- `vendor_maps_address_plz=12345` -- `vendor_maps_address_to=0` (Entfernung zum Hit im Falle von ) - -Analog liest der Klient im Modus `complete` beim Start auch alle bis auf die letzten zwei Query-Parameter wieder ein. Dabei wird die Adresse überschrieben, falls sie nicht zur `vendor_maps_position` passt. +The `index.html` is used in `COMPLETE` mode, which is not run in the AfM. You may, however, use it for testing or inspecting an example. ## Rendering in SINGLE or REPORT mode @@ -72,101 +54,91 @@ A document rendering the map client could e.g. look like this:
-Communicated data:
-Coordinates: null
-Address: null
-Address data: null