Skip to content

Commit 0809a72

Browse files
authored
Improve docs further
1 parent fe53085 commit 0809a72

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,21 @@ To get started it's recommended to have a look at the [demo](./vaadin-maps-leafl
1818
> [!NOTE]
1919
> **The API only supports sending instructions to the client**<br/>
2020
> Due to data integrity retrieving client-side data (that can be modified by users) is not supported.
21-
> * Event listeners can still be registered but this needs to be done manually.<br/>[An example is available in the demo](./vaadin-maps-leaflet-flow-demo/src/main/java/software/xdev/vaadin/maps/leaflet/flow/demo/EventDemo.java).
21+
>
22+
> Event listeners can still be registered but this needs to be done manually. An example is available [in the demo](./vaadin-maps-leaflet-flow-demo/src/main/java/software/xdev/vaadin/maps/leaflet/flow/demo/EventDemo.java).
23+
>
24+
> <details><summary>The following code snippet is a simplification of an even more <a href="./vaadin-maps-leaflet-flow-demo/src/main/java/software/xdev/vaadin/maps/leaflet/flow/demo/ComplexDemo.java#L251">complex example</a> which sends (unvalidated!) client side data back to the server (click to expand)</summary>
25+
>
26+
> ```java
27+
> this.map.on("click", "e => document.getElementById('" + ID + "').$server.mapClicked(e.latlng.lat, e.latng.lng)");
28+
> ...
29+
> @ClientCallable
30+
> public void mapClicked(double lat, double lng)
31+
> {
32+
> LOG.info("Map clicked - lat: {}, lng: {}", lat, lng);
33+
> }
34+
> ```
35+
> </details>
2236
2337
## Installation
2438
[Installation guide of the latest release](https://github.com/xdev-software/vaadin-maps-leaflet-flow/releases/latest#Installation)

0 commit comments

Comments
 (0)