Skip to content

Commit

Permalink
Merge branch 'develop' into update-from-template-merged
Browse files Browse the repository at this point in the history
  • Loading branch information
xdev-gh-bot committed Aug 28, 2024
2 parents 6f29fe3 + 53fa086 commit 9d6cc0d
Show file tree
Hide file tree
Showing 114 changed files with 8,722 additions and 35 deletions.
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github: Leaflet
open_collective: leafletjs
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ body:
attributes:
label: "Checklist"
options:
- label: "I am able to reproduce the bug with the [latest version](https://github.com/xdev-software/template-placeholder/releases/latest)"
- label: "I am able to reproduce the bug with the [latest version](https://github.com/xdev-software/vaadin-maps-leaflet-flow/releases/latest)"
required: true
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/template-placeholder/issues) or [closed](https://github.com/xdev-software/template-placeholder/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/vaadin-maps-leaflet-flow/issues) or [closed](https://github.com/xdev-software/vaadin-maps-leaflet-flow/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
required: true
- label: "I have taken the time to fill in all the required details. I understand that the bug report will be dismissed otherwise."
required: true
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/enhancement.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ body:
attributes:
label: "Checklist"
options:
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/template-placeholder/issues) or [closed](https://github.com/xdev-software/template-placeholder/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/vaadin-maps-leaflet-flow/issues) or [closed](https://github.com/xdev-software/vaadin-maps-leaflet-flow/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
required: true
- label: "I have taken the time to fill in all the required details. I understand that the feature request will be dismissed otherwise."
required: true
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/question.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ body:
attributes:
label: "Checklist"
options:
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/template-placeholder/issues) or [closed](https://github.com/xdev-software/template-placeholder/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/vaadin-maps-leaflet-flow/issues) or [closed](https://github.com/xdev-software/vaadin-maps-leaflet-flow/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
required: true
- label: "I have taken the time to fill in all the required details. I understand that the question will be dismissed otherwise."
required: true
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/no-response.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: No Response

on:
workflow_dispatch:
issue_comment:
types: [created]
schedule:
- cron: '5 5 * * *'

jobs:
noResponse:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- uses: actions/stale@v9
with:
days-before-issue-stale: 7
days-before-issue-close: 3
stale-issue-label: "stale"
only-labels: "waiting-for-response"
labels-to-remove-when-unstale: "waiting-for-response"
stale-issue-message: "This issue will be closed soon because there has been no further activity."
days-before-pr-stale: -1
days-before-pr-close: -1
repo-token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .run/Run Demo.run.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Run Demo" type="Application" factoryName="Application">
<option name="MAIN_CLASS_NAME" value="software.xdev.vaadin.Application" />
<module name="template-placeholder-demo" />
<module name="vaadin-maps-leaflet-flow-demo" />
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
<extension name="coverage">
<pattern>
Expand Down
89 changes: 89 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
## 4.3.0
* Updated to Vaadin 24.4
* Deduplicated ``tLMapZoomPanOptions``

## 4.2.1
* Handle ``LEvented#off`` in the same way as ``LEvented#on``
* Fix incorrect formatting leading to JS error
* Updated dependencies

## 4.2.0
* Fixed some invalid built JavaScript commands #330
* Add basic support for CRS #333
* Added a few new showcase demos
* Updated dependencies

## 4.1.1
* ⚠️ GroupId changed from ``com.xdev-software`` to ``software.xdev``
* Updated dependencies

## 4.1.0
* Provide a workaround that fixes a problem where certain methods didn't work instantly after the map was created #305
* Moved some container specific methods to ``MapContainer``

## 4.0.1
* Added shortcut method ``invokeSelfReturn`` #282
* Updated dependencies

## 4.0.0
⚠️<i>This release contains breaking changes</i>

* The complete API got reworked and now has the [same structure as Leaflet](https://leafletjs.com/reference.html).
* Added lots of new Leaflet APIs - currently around 90% of the Leaflet API are implemented. These include the most useful bits:
* GeoLocation
* A lot of new methods for Map
* Tooltips & Popups
* Image, Video and SVG-Overlays
* Rectangles
* Controls for Scale, Layers, ...
* and much more
* Abstracted the elements similar to how this is done inside Leaflet itself so that they can easily be extended
* 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).
* Event listeners can still be registered but this needs to be done manually. A example is available in the demo.
* All Leaflet elements are now tracked on the client and on the server and can therefore be modified/reused (using ``LComponentManagementRegistry``).
* Before it was only possible to create an element and then send it to the client
* However keep in mind when creating a lot of elements that you may have to free up memory on the client (manually)
* Integrated default Leaflet resources

## 3.0.2
* Added support for Polyline #266 (thanks to @blitzdose)

## 3.0.1
* Fixed ``divIcon`` being displayed incorrectly [due to a default ``iconSize`` of ``12px``](https://github.com/Leaflet/Leaflet/issues/4238) #246
* Updated dependencies
* Updated leaflet to [``1.9.4``](https://github.com/Leaflet/Leaflet/blob/b6b56f6e707142c177fad2f67827a5007e56736a/CHANGELOG.md#194-2023-05-18) #247

## 3.0.0
⚠️<i>This release contains breaking changes</i>

* Adds support for Vaadin 24+, drops support for Vaadin 23<br/>
<i>If you are still using Vaadin 23, use the ``2.x`` versions.</i>
* Requires Java 17+

## 2.0.4
* Added method ``centerAndZoom`` in ``LMap``
* Fixed a problem where an invalid ``iconSize`` was transferred to leaflet which caused a client side exception (#199)
* Updated various dependencies

## 2.0.3
* Updated dependencies
* Fixed problem with setting lon/lan in LMarker
* Added constructors for LMap

## 2.0.2
* Updated dependencies

## 2.0.1
* Updated dependencies
* Vaadin 23.2

## 2.0.0
⚠️<i>This release contains breaking changes</i>

* Update to Vaadin 23
* Removed deprecated polymer-connector - replaced by ``executeJs``
* Fixed a problem where the map was not rendered/aligned correctly
* Don't load anything from remote servers that are not under control of the user
* Shrunk the jar
* Removed default leafletmap tile layer; has to be set manually due to usage policy
* Updated dependency versions
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ Bigger changes may require a complete restart.
* [Vaadin automatically reloads the UI on each restart](https://vaadin.com/docs/latest/configuration/live-reload/spring-boot).<br/>
You can control this behavior with the ``vaadin.devmode.liveReload.enabled`` property (default: ``true``).

## Releasing [![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/template-placeholder/release.yml?branch=master)](https://github.com/xdev-software/template-placeholder/actions/workflows/release.yml)
## Releasing [![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/vaadin-maps-leaflet-flow/release.yml?branch=master)](https://github.com/xdev-software/vaadin-maps-leaflet-flow/actions/workflows/release.yml)

Before releasing:
* Consider doing a [test-deployment](https://github.com/xdev-software/template-placeholder/actions/workflows/test-deploy.yml?query=branch%3Adevelop) before actually releasing.
* Consider doing a [test-deployment](https://github.com/xdev-software/vaadin-maps-leaflet-flow/actions/workflows/test-deploy.yml?query=branch%3Adevelop) before actually releasing.
* Check the [changelog](CHANGELOG.md)

If the ``develop`` is ready for release, create a pull request to the ``master``-Branch and merge the changes
Expand Down
33 changes: 24 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,36 @@
[![Published on Vaadin Directory](https://img.shields.io/badge/Vaadin%20Directory-published-00b4f0?logo=vaadin)](https://vaadin.com/directory/component/template-placeholder)
[![Latest version](https://img.shields.io/maven-central/v/software.xdev/template-placeholder?logo=apache%20maven)](https://mvnrepository.com/artifact/software.xdev/template-placeholder)
[![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/template-placeholder/check-build.yml?branch=develop)](https://github.com/xdev-software/template-placeholder/actions/workflows/check-build.yml?query=branch%3Adevelop)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=xdev-software_template-placeholder&metric=alert_status)](https://sonarcloud.io/dashboard?id=xdev-software_template-placeholder)
[![Published on Vaadin Directory](https://img.shields.io/badge/Vaadin%20Directory-published-00b4f0?logo=vaadin)](https://vaadin.com/directory/component/leafletmap-for-vaadin)
[![Latest version](https://img.shields.io/maven-central/v/software.xdev/vaadin-maps-leaflet-flow?logo=apache%20maven)](https://mvnrepository.com/artifact/software.xdev/vaadin-maps-leaflet-flow)
[![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/vaadin-maps-leaflet-flow/check-build.yml?branch=develop)](https://github.com/xdev-software/vaadin-maps-leaflet-flow/actions/workflows/check-build.yml?query=branch%3Adevelop)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=xdev-software_vaadin-maps-leaflet-flow&metric=alert_status)](https://sonarcloud.io/dashboard?id=xdev-software_vaadin-maps-leaflet-flow)
![Vaadin 24+](https://img.shields.io/badge/Vaadin%20Platform/Flow-24+-00b4f0)

# template-placeholder
A Vaadin Template Repo
# vaadin-maps-leaflet-flow
A Vaadin Flow Java API for [Leaflet](https://leafletjs.com/)

![demo](assets/demo.png)

## Usage

This API wraps the Leaflet API in a Vaadin friendly way.<br/>It uses a similar structure (classes, methods) as the [Leaflet JavaScript API](https://leafletjs.com/reference.html).

To get started it's recommended to have a look at the [demo](./vaadin-maps-leaflet-flow-demo), notably the [minimalistic example](./vaadin-maps-leaflet-flow-demo/src/main/java/software/xdev/vaadin/maps/leaflet/flow/demo/MinimalisticDemo.java).

> [!NOTE]
> **The API only supports sending instructions to the client**<br/>
> Due to data integrity retrieving client-side data (that can be modified by users) is not supported.
> * 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).
## Installation
[Installation guide for the latest release](https://github.com/xdev-software/template-placeholder/releases/latest#Installation)
[Installation guide of the latest release](https://github.com/xdev-software/vaadin-maps-leaflet-flow/releases/latest#Installation)

#### Compatibility with Vaadin
| Vaadin version | vaadin-maps-leaflet-flow version |
| --- | --- |
| Vaadin 24+ (latest) | ``3+`` |

## Run the Demo
* Checkout the repo
* Run ``mvn install && mvn -f template-placeholder-demo spring-boot:run``
* Run ``mvn install && mvn -f vaadin-maps-leaflet-flow-demo spring-boot:run``
* Open http://localhost:8080

<details>
Expand All @@ -31,4 +46,4 @@ If you need support as soon as possible and you can't wait for any pull request,
See the [contributing guide](./CONTRIBUTING.md) for detailed instructions on how to get started with our project.

## Dependencies and Licenses
View the [license of the current project](LICENSE) or the [summary including all dependencies](https://xdev-software.github.io/template-placeholder/dependencies)
View the [license of the current project](LICENSE) or the [summary including all dependencies](https://xdev-software.github.io/vaadin-maps-leaflet-flow/dependencies)
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

## Reporting a Vulnerability

Please report a security vulnerability [on GitHub Security Advisories](https://github.com/xdev-software/template-placeholder/security/advisories/new).
Please report a security vulnerability [on GitHub Security Advisories](https://github.com/xdev-software/vaadin-maps-leaflet-flow/security/advisories/new).
Binary file modified assets/demo.avif
Binary file not shown.
Binary file modified assets/demo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<modelVersion>4.0.0</modelVersion>

<groupId>software.xdev</groupId>
<artifactId>template-placeholder-root</artifactId>
<version>1.0.0-SNAPSHOT</version>
<artifactId>vaadin-maps-leaflet-flow-root</artifactId>
<version>4.3.1-SNAPSHOT</version>
<packaging>pom</packaging>

<organization>
Expand All @@ -15,8 +15,8 @@
</organization>

<modules>
<module>template-placeholder</module>
<module>template-placeholder-demo</module>
<module>vaadin-maps-leaflet-flow</module>
<module>vaadin-maps-leaflet-flow-demo</module>
</modules>

<properties>
Expand Down
2 changes: 1 addition & 1 deletion renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"packageRules": [
{
"description": "Ignore project internal dependencies",
"packagePattern": "^software.xdev:template-placeholder",
"packagePattern": "^software.xdev:vaadin-maps-leaflet-flow",
"datasources": [
"maven"
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

<parent>
<groupId>software.xdev</groupId>
<artifactId>template-placeholder-root</artifactId>
<version>1.0.0-SNAPSHOT</version>
<artifactId>vaadin-maps-leaflet-flow-root</artifactId>
<version>4.3.1-SNAPSHOT</version>
</parent>

<artifactId>template-placeholder-demo</artifactId>
<version>1.0.0-SNAPSHOT</version>
<artifactId>vaadin-maps-leaflet-flow-demo</artifactId>
<version>4.3.1-SNAPSHOT</version>
<packaging>jar</packaging>

<organization>
Expand Down Expand Up @@ -64,7 +64,7 @@
</dependency>
<dependency>
<groupId>software.xdev</groupId>
<artifactId>template-placeholder</artifactId>
<artifactId>vaadin-maps-leaflet-flow</artifactId>
<version>${project.version}</version>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
package software.xdev.vaadin.maps.leaflet.flow;

import java.util.List;

import com.vaadin.flow.component.AttachEvent;
import com.vaadin.flow.component.Composite;
import com.vaadin.flow.component.grid.Grid;
import com.vaadin.flow.component.grid.GridVariant;
import com.vaadin.flow.component.html.Anchor;
import com.vaadin.flow.component.html.Span;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.data.renderer.ComponentRenderer;
import com.vaadin.flow.router.PageTitle;
import com.vaadin.flow.router.Route;

import software.xdev.vaadin.maps.leaflet.flow.demo.ComplexDemo;
import software.xdev.vaadin.maps.leaflet.flow.demo.EventDemo;
import software.xdev.vaadin.maps.leaflet.flow.demo.FreeingUpResourceBenchmarkDemo;
import software.xdev.vaadin.maps.leaflet.flow.demo.InitialResizeDemo;
import software.xdev.vaadin.maps.leaflet.flow.demo.MinimalisticDemo;
import software.xdev.vaadin.maps.leaflet.flow.demo.MultiLayerWithPyramidDemo;
import software.xdev.vaadin.maps.leaflet.flow.demo.NotOfThisEarthDemo;
import software.xdev.vaadin.maps.leaflet.flow.demo.WatermarkControlDemo;


@PageTitle("Leaflet + Vaadin demos")
@Route("")
public class DemoView extends Composite<VerticalLayout>
{
private final Grid<Example> grExamples = new Grid<>();

public DemoView()
{
this.grExamples
.addColumn(new ComponentRenderer<>(example -> {
final Anchor anchor = new Anchor(example.route(), example.name());

final Span spDesc = new Span(example.desc());
spDesc.getStyle().set("font-size", "90%");
spDesc.getStyle().set("white-space", "pre");

final VerticalLayout vl = new VerticalLayout(anchor, spDesc);
vl.setSpacing(false);
return vl;
}))
.setHeader("Available demos");

this.grExamples.setSizeFull();
this.grExamples.addThemeVariants(GridVariant.LUMO_COMPACT, GridVariant.LUMO_NO_BORDER);

this.getContent().add(this.grExamples);
this.getContent().setHeightFull();
}

@Override
protected void onAttach(final AttachEvent attachEvent)
{
this.grExamples.setItems(List.of(
new Example(
MinimalisticDemo.NAV,
"Minimalistic",
"Showcasing the simplest form of using the API"
),
new Example(
InitialResizeDemo.NAV,
"Initial resize",
"Some map methods - when called instantly after the map is created - will not work correctly."
+ " This example shows how to workaround this restriction."
),
new Example(
ComplexDemo.NAV,
"Complex",
"A complex example with various leaflet components and methods"
),
new Example(
EventDemo.NAV,
"Event",
"A showcase how events can work"
),
new Example(
NotOfThisEarthDemo.NAV,
"Not of this earth",
"Displays a map that is not from this earth"
),
new Example(
WatermarkControlDemo.NAV,
"Watermark-Control",
"Creates a custom control interface"
),
new Example(
MultiLayerWithPyramidDemo.NAV,
"Multi-Layer",
"using Pyramids ▲ and more...\n"
+ "Showcases a selection of different layers and how they can be displayed on a map"
),
new Example(
FreeingUpResourceBenchmarkDemo.NAV,
"Freeing up resources Benchmark",
"Benchmark for showcasing how resources a freed up when handling huge amounts of components"
)
));
}

record Example(String route, String name, String desc)
{
}
}
Loading

0 comments on commit 9d6cc0d

Please sign in to comment.