diff --git a/.config/pmd/ruleset.xml b/.config/pmd/ruleset.xml
index 667f74e5..7a03f17c 100644
--- a/.config/pmd/ruleset.xml
+++ b/.config/pmd/ruleset.xml
@@ -151,5 +151,12 @@
+
+
+
+
+
+
+
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
index b6fb79b1..3694b3d1 100644
--- a/.github/ISSUE_TEMPLATE/config.yml
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -1,4 +1,7 @@
contact_links:
+ - name: 🍃 Leaflet docs
+ url: https://leafletjs.com/reference.html
+ about: "Consolidate this when you have questions about Leaflet itself (and not our Vaadin component)"
- name: 💬 Contact support
url: https://xdev.software/en/services/support
about: "If you need support as soon as possible or/and you can't wait for any pull request"
diff --git a/.github/workflows/broken-links.yml b/.github/workflows/broken-links.yml
index 96af7986..8f98f1ad 100644
--- a/.github/workflows/broken-links.yml
+++ b/.github/workflows/broken-links.yml
@@ -11,6 +11,7 @@ permissions:
jobs:
link-checker:
runs-on: ubuntu-latest
+ timeout-minutes: 15
steps:
- uses: actions/checkout@v4
@@ -18,7 +19,9 @@ jobs:
- name: Link Checker
id: lychee
- uses: lycheeverse/lychee-action@v1
+ uses: lycheeverse/lychee-action@v2
+ with:
+ fail: false # Don't fail on broken links, create an issue instead
- name: Find already existing issue
id: find-issue
diff --git a/.github/workflows/check-build.yml b/.github/workflows/check-build.yml
index 93378be5..bd726cc5 100644
--- a/.github/workflows/check-build.yml
+++ b/.github/workflows/check-build.yml
@@ -26,6 +26,7 @@ env:
jobs:
build:
runs-on: ubuntu-latest
+ timeout-minutes: 30
strategy:
matrix:
@@ -73,6 +74,7 @@ jobs:
checkstyle:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'renovate/') }}
+ timeout-minutes: 15
strategy:
matrix:
@@ -95,6 +97,7 @@ jobs:
pmd:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'renovate/') }}
+ timeout-minutes: 15
strategy:
matrix:
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 98416791..49699739 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -14,6 +14,7 @@ permissions:
jobs:
check-code:
runs-on: ubuntu-latest
+ timeout-minutes: 30
steps:
- uses: actions/checkout@v4
@@ -48,6 +49,7 @@ jobs:
prepare-release:
runs-on: ubuntu-latest
needs: [check-code]
+ timeout-minutes: 10
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
@@ -112,6 +114,7 @@ jobs:
publish-maven:
runs-on: ubuntu-latest
needs: [prepare-release]
+ timeout-minutes: 60
steps:
- uses: actions/checkout@v4
@@ -143,6 +146,7 @@ jobs:
publish-pages:
runs-on: ubuntu-latest
needs: [prepare-release]
+ timeout-minutes: 15
steps:
- uses: actions/checkout@v4
@@ -168,10 +172,12 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./${{ env.PRIMARY_MAVEN_MODULE }}/target/site
+ force_orphan: true
after-release:
runs-on: ubuntu-latest
needs: [publish-maven]
+ timeout-minutes: 10
steps:
- uses: actions/checkout@v4
diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml
index b38f0d82..df6dbb7e 100644
--- a/.github/workflows/sonar.yml
+++ b/.github/workflows/sonar.yml
@@ -27,6 +27,7 @@ jobs:
token-check:
runs-on: ubuntu-latest
if: ${{ !(github.event_name == 'pull_request' && startsWith(github.head_ref, 'renovate/')) }}
+ timeout-minutes: 5
outputs:
hasToken: ${{ steps.check-token.outputs.has }}
steps:
@@ -40,6 +41,7 @@ jobs:
runs-on: ubuntu-latest
needs: token-check
if: ${{ needs.token-check.outputs.hasToken }}
+ timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml
index ff880f07..c9d7ec78 100644
--- a/.github/workflows/sync-labels.yml
+++ b/.github/workflows/sync-labels.yml
@@ -14,6 +14,7 @@ permissions:
jobs:
labels:
runs-on: ubuntu-latest
+ timeout-minutes: 10
steps:
- uses: actions/checkout@v4
with:
diff --git a/.github/workflows/test-deploy.yml b/.github/workflows/test-deploy.yml
index e3ed038b..03f5339e 100644
--- a/.github/workflows/test-deploy.yml
+++ b/.github/workflows/test-deploy.yml
@@ -9,6 +9,7 @@ env:
jobs:
publish-maven:
runs-on: ubuntu-latest
+ timeout-minutes: 60
steps:
- uses: actions/checkout@v4
diff --git a/.github/workflows/update-from-template.yml b/.github/workflows/update-from-template.yml
index 36d059ae..905a123f 100644
--- a/.github/workflows/update-from-template.yml
+++ b/.github/workflows/update-from-template.yml
@@ -31,6 +31,7 @@ permissions:
jobs:
update:
runs-on: ubuntu-latest
+ timeout-minutes: 60
outputs:
update_branch_merged_commit: ${{ steps.manage-branches.outputs.update_branch_merged_commit }}
create_update_branch_merged_pr: ${{ steps.manage-branches.outputs.create_update_branch_merged_pr }}
@@ -180,6 +181,7 @@ jobs:
needs: [update]
if: needs.update.outputs.create_update_branch_merged_pr == 1
runs-on: ubuntu-latest
+ timeout-minutes: 60
steps:
- uses: actions/checkout@v4
with:
diff --git a/.idea/checkstyle-idea.xml b/.idea/checkstyle-idea.xml
index eb3fcd83..b52c3e2f 100644
--- a/.idea/checkstyle-idea.xml
+++ b/.idea/checkstyle-idea.xml
@@ -1,7 +1,7 @@
- 10.15.0
+ 10.21.0
JavaOnlyWithTests
true
true
diff --git a/.idea/saveactions_settings.xml b/.idea/saveactions_settings.xml
index 506f17eb..848c311a 100644
--- a/.idea/saveactions_settings.xml
+++ b/.idea/saveactions_settings.xml
@@ -9,7 +9,6 @@
-
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 15f7ffd5..2a0804b8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 4.5.0
+* Added support for [WMS](https://leafletjs.com/reference.html#tilelayer-wms) #486
+* Updated dependencies
+
## 4.4.0
* Added support for [GeoJSON](https://leafletjs.com/reference.html#geojson) and [FeatureGroup](https://leafletjs.com/reference.html#featuregroup) #438
* Add "draggable" property to LMarkerOptions #413 (thanks to @ChristianHoesel)
diff --git a/README.md b/README.md
index 42718a3c..896ec2f3 100644
--- a/README.md
+++ b/README.md
@@ -23,6 +23,11 @@ To get started it's recommended to have a look at the [demo](./vaadin-maps-leafl
## Installation
[Installation guide of the latest release](https://github.com/xdev-software/vaadin-maps-leaflet-flow/releases/latest#Installation)
+#### Static resources
+Please note that Leaflet uses a few default icons for various components (e.g. Markers).
+These are also shipped with the library and can be found inside [``META-INF/resources``](./vaadin-maps-leaflet-flow/src/main/resources/META-INF/resources/).
+You might have to fine tune your security configuration to allow these.
+
#### Compatibility with Vaadin
| Vaadin version | vaadin-maps-leaflet-flow version |
| --- | --- |
diff --git a/pom.xml b/pom.xml
index f73304c0..a9051436 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
software.xdev
vaadin-maps-leaflet-flow-root
- 4.4.1-SNAPSHOT
+ 4.5.0-SNAPSHOT
pom
@@ -40,12 +40,12 @@
org.apache.maven.plugins
maven-checkstyle-plugin
- 3.5.0
+ 3.6.0
com.puppycrawl.tools
checkstyle
- 10.18.1
+ 10.21.1
@@ -70,7 +70,7 @@
org.apache.maven.plugins
maven-pmd-plugin
- 3.25.0
+ 3.26.0
true
true
@@ -82,12 +82,12 @@
net.sourceforge.pmd
pmd-core
- 7.5.0
+ 7.9.0
net.sourceforge.pmd
pmd-java
- 7.5.0
+ 7.9.0
@@ -99,7 +99,7 @@
org.apache.maven.plugins
maven-jxr-plugin
- 3.5.0
+ 3.6.0
diff --git a/vaadin-maps-leaflet-flow-demo/pom.xml b/vaadin-maps-leaflet-flow-demo/pom.xml
index f0670e2a..a9267b0c 100644
--- a/vaadin-maps-leaflet-flow-demo/pom.xml
+++ b/vaadin-maps-leaflet-flow-demo/pom.xml
@@ -7,11 +7,11 @@
software.xdev
vaadin-maps-leaflet-flow-root
- 4.4.1-SNAPSHOT
+ 4.5.0-SNAPSHOT
vaadin-maps-leaflet-flow-demo
- 4.4.1-SNAPSHOT
+ 4.5.0-SNAPSHOT
jar
@@ -29,9 +29,9 @@
software.xdev.vaadin.Application
- 24.4.11
+ 24.6.2
- 3.3.3
+ 3.4.2
@@ -61,6 +61,12 @@
com.vaadin
vaadin-core
+
+
+ com.vaadin
+ hilla-dev
+
+
software.xdev
@@ -72,6 +78,12 @@
com.vaadin
vaadin-spring-boot-starter
+
+
+ com.vaadin
+ hilla
+
+
diff --git a/vaadin-maps-leaflet-flow-demo/src/main/java/software/xdev/vaadin/maps/leaflet/flow/demo/ComplexDemo.java b/vaadin-maps-leaflet-flow-demo/src/main/java/software/xdev/vaadin/maps/leaflet/flow/demo/ComplexDemo.java
index cc1f6ec4..187ecfbc 100644
--- a/vaadin-maps-leaflet-flow-demo/src/main/java/software/xdev/vaadin/maps/leaflet/flow/demo/ComplexDemo.java
+++ b/vaadin-maps-leaflet-flow-demo/src/main/java/software/xdev/vaadin/maps/leaflet/flow/demo/ComplexDemo.java
@@ -33,6 +33,8 @@
import software.xdev.vaadin.maps.leaflet.layer.LLayerGroup;
import software.xdev.vaadin.maps.leaflet.layer.raster.LImageOverlay;
import software.xdev.vaadin.maps.leaflet.layer.raster.LTileLayer;
+import software.xdev.vaadin.maps.leaflet.layer.raster.LTileLayerWMS;
+import software.xdev.vaadin.maps.leaflet.layer.raster.LTileLayerWMSOptions;
import software.xdev.vaadin.maps.leaflet.layer.raster.LVideoOverlay;
import software.xdev.vaadin.maps.leaflet.layer.raster.LVideoOverlayOptions;
import software.xdev.vaadin.maps.leaflet.layer.ui.LMarker;
@@ -89,9 +91,26 @@ public ComplexDemo()
"https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png",
16,
"Map data: © OpenStreetMap contributors, SRTM | Map style: © SRTM | Map style: © OpenTopoMap (CC-BY-SA"
);
+ final LTileLayerWMS tlWMS = new LTileLayerWMS(
+ this.reg,
+ "https://ows.mundialis.de/services/service?",
+ "TOPO-WMS,OSM-Overlay-WMS",
+ 11,
+ "© OpenStreetMap contributors, "
+ + "Terrestris/Mundialis"
+ );
+ final LTileLayerWMS tlWMSUSWeatherData = new LTileLayerWMS(
+ this.reg,
+ "https://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi",
+ new LTileLayerWMSOptions()
+ .withLayers("nexrad-n0r-900913")
+ .withFormat("image/png")
+ .withTransparent(true)
+ .withAttribution("Weather data © 2012 IEM Nexrad")
+ );
final LDivIcon divIconInfo = new LDivIcon(this.reg, new LDivIconOptions()
.withHtml("""
@@ -177,7 +196,7 @@ public ComplexDemo()
.addLayer(tlOSM)
.addLayer(lLayerGroupPlaces);
- this.addControls(tlOSM, tlOSMHOT, tlTopo, lLayerGroupPlaces, lLayerGroupFood);
+ this.addControls(tlOSM, tlOSMHOT, tlTopo, tlWMS, lLayerGroupPlaces, lLayerGroupFood, tlWMSUSWeatherData);
this.hlButtons.setWidthFull();
this.add(this.hlButtons);
@@ -198,20 +217,24 @@ private void addControls(
final LTileLayer tlOSM,
final LTileLayer tlOSMHOT,
final LTileLayer tlTopo,
+ final LTileLayerWMS tlWMS,
final LLayerGroup lLayerGroupPlaces,
- final LLayerGroup lLayerGroupFood)
+ final LLayerGroup lLayerGroupFood,
+ final LTileLayerWMS tlWMSUSWeatherData)
{
// Use LinkedHashMap for order
final LinkedHashMap> baseLayers = new LinkedHashMap<>();
baseLayers.put("OSM", tlOSM);
baseLayers.put("OSM HOT", tlOSMHOT);
baseLayers.put("TOPO", tlTopo);
+ baseLayers.put("WMS", tlWMS);
final LControlLayers lControlLayers = new LControlLayers(
this.reg,
baseLayers,
new LControlLayersOptions().withCollapsed(false))
.addOverlay(lLayerGroupPlaces, "Places")
.addOverlay(lLayerGroupFood, "Food")
+ .addOverlay(tlWMSUSWeatherData, "US Weather data")
.addTo(this.map);
// Apply manual patch for https://github.com/Leaflet/Leaflet/issues/9009 as this was not released yet
this.map.on(
diff --git a/vaadin-maps-leaflet-flow/pom.xml b/vaadin-maps-leaflet-flow/pom.xml
index e9fd893f..514e4abb 100644
--- a/vaadin-maps-leaflet-flow/pom.xml
+++ b/vaadin-maps-leaflet-flow/pom.xml
@@ -6,7 +6,7 @@
software.xdev
vaadin-maps-leaflet-flow
- 4.4.1-SNAPSHOT
+ 4.5.0-SNAPSHOT
jar
vaadin-maps-leaflet-flow
@@ -49,7 +49,7 @@
UTF-8
- 24.4.11
+ 24.6.2
@@ -108,13 +108,13 @@
com.fasterxml.jackson.core
jackson-databind
- 2.17.2
+ 2.18.2
org.apache.commons
commons-text
- 1.12.0
+ 1.13.0
@@ -129,7 +129,7 @@
org.apache.maven.plugins
maven-project-info-reports-plugin
- 3.7.0
+ 3.8.0
@@ -137,7 +137,7 @@
com.mycila
license-maven-plugin
- 4.5
+ 4.6
${project.organization.url}
@@ -192,11 +192,11 @@
org.apache.maven.plugins
maven-javadoc-plugin
- 3.10.0
+ 3.11.2
attach-javadocs
- verify
+ package
jar
@@ -214,7 +214,7 @@
attach-sources
- verify
+ package
jar-no-fork
@@ -272,7 +272,7 @@
org.apache.maven.plugins
maven-gpg-plugin
- 3.2.5
+ 3.2.7
sign-artifacts
@@ -315,12 +315,12 @@
org.apache.maven.plugins
maven-checkstyle-plugin
- 3.5.0
+ 3.6.0
com.puppycrawl.tools
checkstyle
- 10.18.1
+ 10.21.1
@@ -345,7 +345,7 @@
org.apache.maven.plugins
maven-pmd-plugin
- 3.25.0
+ 3.26.0
true
true
@@ -357,12 +357,12 @@
net.sourceforge.pmd
pmd-core
- 7.5.0
+ 7.9.0
net.sourceforge.pmd
pmd-java
- 7.5.0
+ 7.9.0
@@ -374,7 +374,7 @@
org.apache.maven.plugins
maven-jxr-plugin
- 3.5.0
+ 3.6.0
diff --git a/vaadin-maps-leaflet-flow/src/main/java/software/xdev/vaadin/maps/leaflet/layer/raster/LAbstractTileLayer.java b/vaadin-maps-leaflet-flow/src/main/java/software/xdev/vaadin/maps/leaflet/layer/raster/LAbstractTileLayer.java
new file mode 100644
index 00000000..0ffb27fd
--- /dev/null
+++ b/vaadin-maps-leaflet-flow/src/main/java/software/xdev/vaadin/maps/leaflet/layer/raster/LAbstractTileLayer.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright © 2019 XDEV Software (https://xdev.software)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package software.xdev.vaadin.maps.leaflet.layer.raster;
+
+import java.io.Serializable;
+
+import software.xdev.vaadin.maps.leaflet.layer.LGridLayer;
+import software.xdev.vaadin.maps.leaflet.registry.LComponentManagementRegistry;
+
+
+/**
+ * Represents a tile layer.
+ */
+public abstract class LAbstractTileLayer> extends LGridLayer
+{
+ protected LAbstractTileLayer(
+ final LComponentManagementRegistry compReg,
+ final String jsConstructorCallExpression,
+ final Serializable... parameters)
+ {
+ super(compReg, jsConstructorCallExpression, parameters);
+ }
+}
diff --git a/vaadin-maps-leaflet-flow/src/main/java/software/xdev/vaadin/maps/leaflet/layer/raster/LAbstractTileLayerOptions.java b/vaadin-maps-leaflet-flow/src/main/java/software/xdev/vaadin/maps/leaflet/layer/raster/LAbstractTileLayerOptions.java
new file mode 100644
index 00000000..7a593470
--- /dev/null
+++ b/vaadin-maps-leaflet-flow/src/main/java/software/xdev/vaadin/maps/leaflet/layer/raster/LAbstractTileLayerOptions.java
@@ -0,0 +1,165 @@
+/*
+ * Copyright © 2019 XDEV Software (https://xdev.software)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package software.xdev.vaadin.maps.leaflet.layer.raster;
+
+import software.xdev.vaadin.maps.leaflet.layer.LGridLayerOptions;
+
+
+/**
+ * @see Leaflet docs
+ */
+public abstract class LAbstractTileLayerOptions> extends LGridLayerOptions
+{
+ // String|String[]
+ private Object subdomains;
+ private String errorTileUrl;
+ private Integer zoomOffset;
+ private Boolean tms;
+ private Boolean zoomReverse;
+ private Boolean detectRetina;
+ // Boolean|String
+ private Object crossOrigin;
+ // Boolean|String
+ private Object referrerPolicy;
+
+ public Object getSubdomains()
+ {
+ return this.subdomains;
+ }
+
+ public void setSubdomains(final Object subdomains)
+ {
+ this.subdomains = subdomains;
+ }
+
+ public S withSubdomains(final Object subdomains)
+ {
+ this.setSubdomains(subdomains);
+ return this.self();
+ }
+
+ public String getErrorTileUrl()
+ {
+ return this.errorTileUrl;
+ }
+
+ public void setErrorTileUrl(final String errorTileUrl)
+ {
+ this.errorTileUrl = errorTileUrl;
+ }
+
+ public S withErrorTileUrl(final String errorTileUrl)
+ {
+ this.setErrorTileUrl(errorTileUrl);
+ return this.self();
+ }
+
+ public Integer getZoomOffset()
+ {
+ return this.zoomOffset;
+ }
+
+ public void setZoomOffset(final Integer zoomOffset)
+ {
+ this.zoomOffset = zoomOffset;
+ }
+
+ public S withZoomOffset(final Integer zoomOffset)
+ {
+ this.setZoomOffset(zoomOffset);
+ return this.self();
+ }
+
+ public Boolean getTms()
+ {
+ return this.tms;
+ }
+
+ public void setTms(final Boolean tms)
+ {
+ this.tms = tms;
+ }
+
+ public S withTms(final Boolean tms)
+ {
+ this.setTms(tms);
+ return this.self();
+ }
+
+ public Boolean getZoomReverse()
+ {
+ return this.zoomReverse;
+ }
+
+ public void setZoomReverse(final Boolean zoomReverse)
+ {
+ this.zoomReverse = zoomReverse;
+ }
+
+ public S withZoomReverse(final Boolean zoomReverse)
+ {
+ this.setZoomReverse(zoomReverse);
+ return this.self();
+ }
+
+ public Boolean getDetectRetina()
+ {
+ return this.detectRetina;
+ }
+
+ public void setDetectRetina(final Boolean detectRetina)
+ {
+ this.detectRetina = detectRetina;
+ }
+ public S withDetectRetina(final Boolean detectRetina)
+ {
+ this.setDetectRetina(detectRetina);
+ return this.self();
+ }
+
+
+ public Object getCrossOrigin()
+ {
+ return this.crossOrigin;
+ }
+
+ public void setCrossOrigin(final Object crossOrigin)
+ {
+ this.crossOrigin = crossOrigin;
+ }
+
+ public S withCrossOrigin(final Object crossOrigin)
+ {
+ this.setCrossOrigin(crossOrigin);
+ return this.self();
+ }
+
+ public Object getReferrerPolicy()
+ {
+ return this.referrerPolicy;
+ }
+
+ public void setReferrerPolicy(final Object referrerPolicy)
+ {
+ this.referrerPolicy = referrerPolicy;
+ }
+
+ public S withReferrerPolicy(final Object referrerPolicy)
+ {
+ this.setReferrerPolicy(referrerPolicy);
+ return this.self();
+ }
+}
diff --git a/vaadin-maps-leaflet-flow/src/main/java/software/xdev/vaadin/maps/leaflet/layer/raster/LTileLayer.java b/vaadin-maps-leaflet-flow/src/main/java/software/xdev/vaadin/maps/leaflet/layer/raster/LTileLayer.java
index 0dcb8300..4bed39e2 100644
--- a/vaadin-maps-leaflet-flow/src/main/java/software/xdev/vaadin/maps/leaflet/layer/raster/LTileLayer.java
+++ b/vaadin-maps-leaflet-flow/src/main/java/software/xdev/vaadin/maps/leaflet/layer/raster/LTileLayer.java
@@ -15,7 +15,6 @@
*/
package software.xdev.vaadin.maps.leaflet.layer.raster;
-import software.xdev.vaadin.maps.leaflet.layer.LGridLayer;
import software.xdev.vaadin.maps.leaflet.registry.LComponentManagementRegistry;
@@ -30,7 +29,7 @@
*
* @see List of raster tile providers
*/
-public class LTileLayer extends LGridLayer
+public class LTileLayer extends LAbstractTileLayer
{
public LTileLayer(
final LComponentManagementRegistry compReg,
diff --git a/vaadin-maps-leaflet-flow/src/main/java/software/xdev/vaadin/maps/leaflet/layer/raster/LTileLayerOptions.java b/vaadin-maps-leaflet-flow/src/main/java/software/xdev/vaadin/maps/leaflet/layer/raster/LTileLayerOptions.java
index 4e559322..7b46ce5a 100644
--- a/vaadin-maps-leaflet-flow/src/main/java/software/xdev/vaadin/maps/leaflet/layer/raster/LTileLayerOptions.java
+++ b/vaadin-maps-leaflet-flow/src/main/java/software/xdev/vaadin/maps/leaflet/layer/raster/LTileLayerOptions.java
@@ -15,151 +15,9 @@
*/
package software.xdev.vaadin.maps.leaflet.layer.raster;
-import software.xdev.vaadin.maps.leaflet.layer.LGridLayerOptions;
-
-
/**
* @see Leaflet docs
*/
-public class LTileLayerOptions extends LGridLayerOptions
+public class LTileLayerOptions extends LAbstractTileLayerOptions
{
- // String|String[]
- private Object subdomains;
- private String errorTileUrl;
- private Integer zoomOffset;
- private Boolean tms;
- private Boolean zoomReverse;
- private Boolean detectRetina;
- // Boolean|String
- private Object crossOrigin;
- // Boolean|String
- private Object referrerPolicy;
-
- public Object getSubdomains()
- {
- return this.subdomains;
- }
-
- public void setSubdomains(final Object subdomains)
- {
- this.subdomains = subdomains;
- }
-
- public LTileLayerOptions withSubdomains(final Object subdomains)
- {
- this.setSubdomains(subdomains);
- return this.self();
- }
-
- public String getErrorTileUrl()
- {
- return this.errorTileUrl;
- }
-
- public void setErrorTileUrl(final String errorTileUrl)
- {
- this.errorTileUrl = errorTileUrl;
- }
-
- public LTileLayerOptions withErrorTileUrl(final String errorTileUrl)
- {
- this.setErrorTileUrl(errorTileUrl);
- return this.self();
- }
-
- public Integer getZoomOffset()
- {
- return this.zoomOffset;
- }
-
- public void setZoomOffset(final Integer zoomOffset)
- {
- this.zoomOffset = zoomOffset;
- }
-
- public LTileLayerOptions withZoomOffset(final Integer zoomOffset)
- {
- this.setZoomOffset(zoomOffset);
- return this.self();
- }
-
- public Boolean getTms()
- {
- return this.tms;
- }
-
- public void setTms(final Boolean tms)
- {
- this.tms = tms;
- }
-
- public LTileLayerOptions withTms(final Boolean tms)
- {
- this.setTms(tms);
- return this.self();
- }
-
- public Boolean getZoomReverse()
- {
- return this.zoomReverse;
- }
-
- public void setZoomReverse(final Boolean zoomReverse)
- {
- this.zoomReverse = zoomReverse;
- }
-
- public LTileLayerOptions withZoomReverse(final Boolean zoomReverse)
- {
- this.setZoomReverse(zoomReverse);
- return this.self();
- }
-
- public Boolean getDetectRetina()
- {
- return this.detectRetina;
- }
-
- public void setDetectRetina(final Boolean detectRetina)
- {
- this.detectRetina = detectRetina;
- }
- public LTileLayerOptions withDetectRetina(final Boolean detectRetina)
- {
- this.setDetectRetina(detectRetina);
- return this.self();
- }
-
-
- public Object getCrossOrigin()
- {
- return this.crossOrigin;
- }
-
- public void setCrossOrigin(final Object crossOrigin)
- {
- this.crossOrigin = crossOrigin;
- }
-
- public LTileLayerOptions withCrossOrigin(final Object crossOrigin)
- {
- this.setCrossOrigin(crossOrigin);
- return this.self();
- }
-
- public Object getReferrerPolicy()
- {
- return this.referrerPolicy;
- }
-
- public void setReferrerPolicy(final Object referrerPolicy)
- {
- this.referrerPolicy = referrerPolicy;
- }
-
- public LTileLayerOptions withReferrerPolicy(final Object referrerPolicy)
- {
- this.setReferrerPolicy(referrerPolicy);
- return this.self();
- }
}
diff --git a/vaadin-maps-leaflet-flow/src/main/java/software/xdev/vaadin/maps/leaflet/layer/raster/LTileLayerWMS.java b/vaadin-maps-leaflet-flow/src/main/java/software/xdev/vaadin/maps/leaflet/layer/raster/LTileLayerWMS.java
new file mode 100644
index 00000000..ad98ce3a
--- /dev/null
+++ b/vaadin-maps-leaflet-flow/src/main/java/software/xdev/vaadin/maps/leaflet/layer/raster/LTileLayerWMS.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright © 2019 XDEV Software (https://xdev.software)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package software.xdev.vaadin.maps.leaflet.layer.raster;
+
+import software.xdev.vaadin.maps.leaflet.registry.LComponentManagementRegistry;
+
+
+/**
+ * Represents a WMS tile layer.
+ */
+public class LTileLayerWMS extends LAbstractTileLayer
+{
+ public LTileLayerWMS(
+ final LComponentManagementRegistry compReg,
+ final String baseUrl,
+ final LTileLayerWMSOptions options)
+ {
+ super(compReg, "L.tileLayer.wms($0" + compReg.writeOptionsOptionalNextParameter(options) + ")", baseUrl);
+ }
+
+ public LTileLayerWMS(
+ final LComponentManagementRegistry compReg,
+ final String baseUrl,
+ final String layers)
+ {
+ this(compReg, baseUrl, new LTileLayerWMSOptions().withLayers(layers));
+ }
+
+ public LTileLayerWMS(
+ final LComponentManagementRegistry compReg,
+ final String baseUrl,
+ final String layers,
+ final int maxZoom,
+ final String attribution)
+ {
+ this(compReg, baseUrl, new LTileLayerWMSOptions()
+ .withLayers(layers)
+ .withMaxZoom(maxZoom)
+ .withAttribution(attribution));
+ }
+}
diff --git a/vaadin-maps-leaflet-flow/src/main/java/software/xdev/vaadin/maps/leaflet/layer/raster/LTileLayerWMSOptions.java b/vaadin-maps-leaflet-flow/src/main/java/software/xdev/vaadin/maps/leaflet/layer/raster/LTileLayerWMSOptions.java
new file mode 100644
index 00000000..189fee4b
--- /dev/null
+++ b/vaadin-maps-leaflet-flow/src/main/java/software/xdev/vaadin/maps/leaflet/layer/raster/LTileLayerWMSOptions.java
@@ -0,0 +1,143 @@
+/*
+ * Copyright © 2019 XDEV Software (https://xdev.software)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package software.xdev.vaadin.maps.leaflet.layer.raster;
+
+
+/**
+ * @see Leaflet docs
+ */
+public class LTileLayerWMSOptions extends LAbstractTileLayerOptions
+{
+ private String layers;
+ private String styles;
+ private String format;
+ private Boolean transparent;
+ private String version;
+ private Object crs;
+ private Boolean uppercase;
+
+ public String getLayers()
+ {
+ return this.layers;
+ }
+
+ public void setLayers(final String layers)
+ {
+ this.layers = layers;
+ }
+
+ public LTileLayerWMSOptions withLayers(final String layers)
+ {
+ this.setLayers(layers);
+ return this.self();
+ }
+
+ public String getStyles()
+ {
+ return this.styles;
+ }
+
+ public void setStyles(final String styles)
+ {
+ this.styles = styles;
+ }
+
+ public LTileLayerWMSOptions withStyles(final String styles)
+ {
+ this.setStyles(styles);
+ return this.self();
+ }
+
+ public String getFormat()
+ {
+ return this.format;
+ }
+
+ public void setFormat(final String format)
+ {
+ this.format = format;
+ }
+
+ public LTileLayerWMSOptions withFormat(final String format)
+ {
+ this.setFormat(format);
+ return this.self();
+ }
+
+ public Boolean getTransparent()
+ {
+ return this.transparent;
+ }
+
+ public void setTransparent(final Boolean transparent)
+ {
+ this.transparent = transparent;
+ }
+
+ public LTileLayerWMSOptions withTransparent(final Boolean transparent)
+ {
+ this.setTransparent(transparent);
+ return this.self();
+ }
+
+ public String getVersion()
+ {
+ return this.version;
+ }
+
+ public void setVersion(final String version)
+ {
+ this.version = version;
+ }
+
+ public LTileLayerWMSOptions withVersion(final String version)
+ {
+ this.setVersion(version);
+ return this.self();
+ }
+
+ public Object getCrs()
+ {
+ return this.crs;
+ }
+
+ public void setCrs(final Object crs)
+ {
+ this.crs = crs;
+ }
+
+ public LTileLayerWMSOptions withCrs(final Object crs)
+ {
+ this.setCrs(crs);
+ return this.self();
+ }
+
+ public Boolean getUppercase()
+ {
+ return this.uppercase;
+ }
+
+ public void setUppercase(final Boolean uppercase)
+ {
+ this.uppercase = uppercase;
+ }
+
+ public LTileLayerWMSOptions withUppercase(final Boolean uppercase)
+ {
+ this.setUppercase(uppercase);
+ return this.self();
+ }
+}