kopia lustrzana https://github.com/FacilMap/facilmap
Update client docs
rodzic
996ec4516f
commit
7838195e10
|
@ -17,15 +17,14 @@ Install facilmap-client as a dependency using npm or yarn:
|
|||
npm install -S facilmap-client
|
||||
```
|
||||
|
||||
or load the client directly from facilmap.org (along with socket.io, which is needed by facilmap-client):
|
||||
or import the client from a CDN (only recommended for test purposes):
|
||||
|
||||
```html
|
||||
<script src="https://unpkg.com/socket.io-client@4"></script>
|
||||
<script src="https://unpkg.com/facilmap-client@3"></script>
|
||||
<script type="module">
|
||||
import Client from "https://esm.sh/facilmap-client";
|
||||
</script>
|
||||
```
|
||||
|
||||
The client class will be available as the global `FacilMap.Client` variable.
|
||||
|
||||
|
||||
## TypeScript
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ A bounding box that describes which part of the map the user is currently viewin
|
|||
* `shape` (string): The shape name for the marker. Default is an empty string (equivalent to `"drop"`).
|
||||
* `ele` (number or null): The elevation of this marker in metres (set by the server)
|
||||
* `typeId` (number): The ID of the type of this marker
|
||||
* `data` (<code>{ [fieldName: string]: string }</code>): The filled out form fields of the marker. By default, this is a null-prototype object to avoid prototype pollution. Have a look at [marker/line data](./advanced.md#marker-line-data) for more details.
|
||||
* `data` (<code>{ [fieldName: string]: string }</code>): The filled out form fields of the marker. This is a null-prototype object to avoid prototype pollution.
|
||||
|
||||
## Line
|
||||
|
||||
|
@ -52,7 +52,7 @@ separately through `linePoints` events.
|
|||
* `left`, `top`, `right`, `bottom` (number): The bounding box of the line (set by the server)
|
||||
* `extraInfo` (<code>{ [type: string]: Array<[startIdx: number, endIdx: number, type: number]>> }</code> or null): Extra details about the route (set by the server). `type` can be for example `steepness`, `surface` or `waytype`. `startIdx` and `endIdx` describe a segment on the trackpoints of the route, the meaning of `type` can be seen in the documentation of [Leaflet.Heightgraph](https://github.com/GIScience/Leaflet.Heightgraph/blob/master/example/mappings.js).
|
||||
* `typeId` (number): The ID of the type of this line
|
||||
* `data` (<code>{ [fieldName: string]: string }</code>): The filled out form fields of the line. By default, this is a null-prototype object to avoid prototype pollution. Have a look at [marker/line data](./advanced.md#marker-line-data) for more details.
|
||||
* `data` (<code>{ [fieldName: string]: string }</code>): The filled out form fields of the line. This is a null-prototype object to avoid prototype pollution.
|
||||
* `trackPoints`:
|
||||
* In the `lines` property of the client, an object of the format [<code>{ [idx: number]: TrackPoint }</code>](#trackpoint)
|
||||
* When creating/updating a line with the routing mode `track`, an array of the format [`TrackPoint[]`](#trackpoint)
|
||||
|
|
Ładowanie…
Reference in New Issue