Skip to content

Commit 2ed4a1f

Browse files
authored
Merge pull request #278 from xdev-software/develop
Release 4.0.0
2 parents b9466c2 + 3ffad22 commit 2ed4a1f

File tree

111 files changed

+7712
-2468
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+7712
-2468
lines changed

.github/workflows/release.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -223,9 +223,12 @@ jobs:
223223
git push origin
224224
225225
- name: pull-request
226-
uses: repo-sync/pull-request@v2
227-
with:
228-
destination_branch: "develop"
229-
pr_title: "Sync back"
230-
pr_body: "An automated PR to sync changes back"
231-
226+
env:
227+
GH_TOKEN: ${{ github.token }}
228+
run: |
229+
gh_pr_up() {
230+
gh pr create "$@" || gh pr edit "$@"
231+
}
232+
gh_pr_up -B "develop" \
233+
--title "Sync back" \
234+
--body "An automated PR to sync changes back"

.github/workflows/update-from-template.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,14 @@ jobs:
8181
echo "abort=0" >> $GITHUB_OUTPUT
8282
8383
- name: pull-request
84-
uses: repo-sync/pull-request@v2
8584
if: steps.main.outputs.abort == 0
86-
with:
87-
github_token: ${{ secrets.GITHUB_TOKEN }}
88-
source_branch: ${{ env.UPDATE_BRANCH }}
89-
destination_branch: ${{ steps.main.outputs.current_branch }}
90-
pr_title: "Update from template"
91-
pr_body: "An automated PR to sync changes from the template into this repo"
92-
85+
env:
86+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
87+
run: |
88+
gh_pr_up() {
89+
gh pr create "$@" || gh pr edit "$@"
90+
}
91+
gh_pr_up -B "${{ steps.main.outputs.current_branch }}" \
92+
-H "${{ env.UPDATE_BRANCH }}" \
93+
--title "Update from template" \
94+
--body "An automated PR to sync changes from the template into this repo"

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
## 4.0.0
2+
⚠️<i>This release contains breaking changes</i>
3+
4+
* The complete API got reworked and now has the [same structure as Leaflet](https://leafletjs.com/reference.html).
5+
* Added lots of new Leaflet APIs - currently around 90% of the Leaflet API are implemented. These include the most useful bits:
6+
* GeoLocation
7+
* A lot of new methods for Map
8+
* Tooltips & Popups
9+
* Image, Video and SVG-Overlays
10+
* Rectangles
11+
* Controls for Scale, Layers, ...
12+
* and much more
13+
* Abstracted the elements similar to how this is done inside Leaflet itself so that they can easily be extended
14+
* The API only supports sending instructions to the client. Retrieving client side data is not supported as data integrity can't be guaranteed (client-side data can be modified by users).
15+
* Event listeners can still be registered but this needs to be done manually. A example is available in the demo.
16+
* All Leaflet elements are now tracked on the client and on the server and can therefore be modified/reused (using ``LComponentManagementRegistry``).
17+
* Before it was only possible to create an element and then send it to the client
18+
* However keep in mind when creating a lot of elements that you may have to free up memory on the client (manually)
19+
* Integrated default Leaflet resources
20+
121
## 3.0.2
222
* Added support for Polyline #266 (thanks to @blitzdose)
323

@@ -7,6 +27,8 @@
727
* Updated leaflet to [``1.9.4``](https://github.com/Leaflet/Leaflet/blob/b6b56f6e707142c177fad2f67827a5007e56736a/CHANGELOG.md#194-2023-05-18) #247
828

929
## 3.0.0
30+
⚠️<i>This release contains breaking changes</i>
31+
1032
* Adds support for Vaadin 24+, drops support for Vaadin 23<br/>
1133
<i>If you are still using Vaadin 23, use the ``2.x`` versions.</i>
1234
* Requires Java 17+
@@ -29,6 +51,8 @@
2951
* Vaadin 23.2
3052

3153
## 2.0.0
54+
⚠️<i>This release contains breaking changes</i>
55+
3256
* Update to Vaadin 23
3357
* Removed deprecated polymer-connector - replaced by ``executeJs``
3458
* Fixed a problem where the map was not rendered/aligned correctly

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
![Vaadin 24+](https://img.shields.io/badge/Vaadin%20Platform/Flow-24+-00b4f0)
66

77
# vaadin-maps-leaflet-flow
8-
Vaadin Flow Java API for [Leaflet Maps](https://leafletjs.com/) Component
8+
Vaadin Flow Java API for [Leaflet](https://leafletjs.com/)
9+
10+
This API wraps the Leaflet API in a Vaadin friendly way.
11+
To get started it's recommended to have a look at the demo (notably at the [minimalistic example](./vaadin-maps-leaflet-flow-demo/src/main/java/software/xdev/vaadin/maps/leaflet/flow/demo/MinimalisticDemo.java))
912

1013
![demo](assets/demo.png)
1114

@@ -31,7 +34,7 @@ Vaadin Flow Java API for [Leaflet Maps](https://leafletjs.com/) Component
3134
<details>
3235
<summary>Show example</summary>
3336

34-
![demo](assets/demo.gif)
37+
![demo](assets/demo.avif)
3538
</details>
3639

3740
## Support

assets/demo.avif

2.46 MB
Binary file not shown.

assets/demo.gif

-2.03 MB
Binary file not shown.

assets/demo.png

-381 KB
Loading

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>com.xdev-software</groupId>
88
<artifactId>vaadin-maps-leaflet-flow-root</artifactId>
9-
<version>3.0.3-SNAPSHOT</version>
9+
<version>4.0.0-SNAPSHOT</version>
1010
<packaging>pom</packaging>
1111

1212
<organization>

vaadin-maps-leaflet-flow-demo/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>com.xdev-software</groupId>
88
<artifactId>vaadin-maps-leaflet-flow-demo</artifactId>
9-
<version>3.0.3-SNAPSHOT</version>
9+
<version>4.0.0-SNAPSHOT</version>
1010
<packaging>jar</packaging>
1111

1212
<inceptionYear>2019</inceptionYear>
@@ -26,9 +26,9 @@
2626
<mainClass>software.xdev.vaadin.Application</mainClass>
2727

2828
<!-- Dependency-Versions -->
29-
<vaadin.version>24.1.8</vaadin.version>
29+
<vaadin.version>24.1.11</vaadin.version>
3030

31-
<org.springframework.boot.version>3.1.3</org.springframework.boot.version>
31+
<org.springframework.boot.version>3.1.4</org.springframework.boot.version>
3232
</properties>
3333

3434
<dependencyManagement>
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
package software.xdev.vaadin.maps.leaflet.flow;
2+
3+
import java.util.List;
4+
5+
import com.vaadin.flow.component.AttachEvent;
6+
import com.vaadin.flow.component.Composite;
7+
import com.vaadin.flow.component.grid.Grid;
8+
import com.vaadin.flow.component.grid.GridVariant;
9+
import com.vaadin.flow.component.html.Anchor;
10+
import com.vaadin.flow.component.html.Span;
11+
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
12+
import com.vaadin.flow.data.renderer.ComponentRenderer;
13+
import com.vaadin.flow.router.PageTitle;
14+
import com.vaadin.flow.router.Route;
15+
16+
import software.xdev.vaadin.maps.leaflet.flow.demo.ComplexDemo;
17+
import software.xdev.vaadin.maps.leaflet.flow.demo.FreeingUpResourceBenchmarkDemo;
18+
import software.xdev.vaadin.maps.leaflet.flow.demo.MinimalisticDemo;
19+
20+
21+
@PageTitle("Leaflet + Vaadin demos")
22+
@Route("")
23+
public class DemoView extends Composite<VerticalLayout>
24+
{
25+
private final Grid<Example> grExamples = new Grid<>();
26+
27+
public DemoView()
28+
{
29+
this.grExamples
30+
.addColumn(new ComponentRenderer<>(example -> {
31+
final Anchor anchor = new Anchor(example.route(), example.name());
32+
33+
final Span spDesc = new Span(example.desc());
34+
spDesc.getStyle().set("font-size", "90%");
35+
36+
final VerticalLayout vl = new VerticalLayout(anchor, spDesc);
37+
vl.setSpacing(false);
38+
return vl;
39+
}))
40+
.setHeader("Available demos");
41+
42+
this.grExamples.setSizeFull();
43+
this.grExamples.addThemeVariants(GridVariant.LUMO_COMPACT, GridVariant.LUMO_NO_BORDER);
44+
45+
this.getContent().add(this.grExamples);
46+
this.getContent().setHeightFull();
47+
}
48+
49+
@Override
50+
protected void onAttach(final AttachEvent attachEvent)
51+
{
52+
this.grExamples.setItems(List.of(
53+
new Example(
54+
MinimalisticDemo.NAV,
55+
"Minimalistic",
56+
"Showcasing the simplest form of using the API"
57+
),
58+
new Example(
59+
ComplexDemo.NAV,
60+
"Complex",
61+
"A complex example with various leaflet components and methods"
62+
),
63+
new Example(
64+
FreeingUpResourceBenchmarkDemo.NAV,
65+
"Freeing up resources Benchmark",
66+
"Benchmark for showcasing how resources a freed up when handling huge amounts of components"
67+
)
68+
));
69+
}
70+
71+
record Example(String route, String name, String desc)
72+
{
73+
}
74+
}

0 commit comments

Comments
 (0)