Skip to content

Commit

Permalink
Changed all occurrences of Integer and Double to Number f…
Browse files Browse the repository at this point in the history
…or improved compatibility with Leaflet's API

Fixes #499
  • Loading branch information
AB-xdev committed Feb 14, 2025
1 parent 151c692 commit f891b5e
Show file tree
Hide file tree
Showing 27 changed files with 215 additions and 206 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 4.6.0
* Changed all occurrences of ``Integer`` and ``Double`` to ``Number`` for improved compatibility with Leaflet's API

## 4.5.0
* Added support for [WMS](https://leafletjs.com/reference.html#tilelayer-wms) #486
* Updated dependencies
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>software.xdev</groupId>
<artifactId>vaadin-maps-leaflet-flow-root</artifactId>
<version>4.5.1-SNAPSHOT</version>
<version>4.6.0-SNAPSHOT</version>
<packaging>pom</packaging>

<organization>
Expand Down
4 changes: 2 additions & 2 deletions vaadin-maps-leaflet-flow-demo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
<parent>
<groupId>software.xdev</groupId>
<artifactId>vaadin-maps-leaflet-flow-root</artifactId>
<version>4.5.1-SNAPSHOT</version>
<version>4.6.0-SNAPSHOT</version>
</parent>

<artifactId>vaadin-maps-leaflet-flow-demo</artifactId>
<version>4.5.1-SNAPSHOT</version>
<version>4.6.0-SNAPSHOT</version>
<packaging>jar</packaging>

<organization>
Expand Down
2 changes: 1 addition & 1 deletion vaadin-maps-leaflet-flow/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>software.xdev</groupId>
<artifactId>vaadin-maps-leaflet-flow</artifactId>
<version>4.5.1-SNAPSHOT</version>
<version>4.6.0-SNAPSHOT</version>
<packaging>jar</packaging>

<name>vaadin-maps-leaflet-flow</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

public interface LHasOpacity<S extends LHasOpacity<S>> extends LComponent<S>
{
default S setOpacity(final Double opacity)
default S setOpacity(final Number opacity)
{
this.invokeSelf(".setOpacity($0)", opacity);
return this.self();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

public interface LHasSetZIndex<S extends LHasSetZIndex<S>> extends LComponent<S>
{
default S setZIndex(final Integer zIndex)
default S setZIndex(final Number zIndex)
{
this.invokeSelf(".setZIndex($0)", zIndex);
return this.self();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@
*/
public class LControlScaleOptions extends LControlOptions<LControlScaleOptions>
{
private Integer maxWidth;
private Number maxWidth;
private Boolean metric;
private Boolean imperial;
private Boolean updateWhenIdle;

public Integer getMaxWidth()
public Number getMaxWidth()
{
return this.maxWidth;
}

public void setMaxWidth(final Integer maxWidth)
public void setMaxWidth(final Number maxWidth)
{
this.maxWidth = maxWidth;
}

public LControlScaleOptions withMaxWidth(final Integer maxWidth)
public LControlScaleOptions withMaxWidth(final Number maxWidth)
{
this.setMaxWidth(maxWidth);
return this.self();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,29 @@
*/
package software.xdev.vaadin.maps.leaflet.layer;

@SuppressWarnings("unused")
public abstract class LAbstractImageOverlayOptions<S extends LAbstractImageOverlayOptions<S>>
extends LInteractiveLayerOptions<S>
{
private Double opacity;
private Number opacity;
private String alt;
// Boolean|String
private Object crossOrigin;
private String errorOverlayUrl;
private Integer zIndex;
private Number zIndex;
private String className;

public Double getOpacity()
public Number getOpacity()
{
return this.opacity;
}

public void setOpacity(final Double opacity)
public void setOpacity(final Number opacity)
{
this.opacity = opacity;
}

public S withOpacity(final Double opacity)
public S withOpacity(final Number opacity)
{
this.setOpacity(opacity);
return this.self();
Expand Down Expand Up @@ -90,17 +91,17 @@ public S withErrorOverlayUrl(final String errorOverlayUrl)
return this.self();
}

public Integer getzIndex()
public Number getzIndex()
{
return this.zIndex;
}

public void setzIndex(final Integer zIndex)
public void setzIndex(final Number zIndex)
{
this.zIndex = zIndex;
}

public S withZIndex(final Integer zIndex)
public S withZIndex(final Number zIndex)
{
this.setzIndex(zIndex);
return this.self();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@ public abstract class LGridLayerOptions<S extends LGridLayerOptions<S>> extends
{
// Number|Point
private Object tileSize;
private Double opacity;
private Number opacity;
private Boolean updateWhenIdle;
private Boolean updateWhenZooming;
private Integer updateInterval;
private Integer zIndex;
private Number updateInterval;
private Number zIndex;
private LLatLngBounds latLngBounds;
private Integer minZoom;
private Integer maxZoom;
private Integer minNativeZoom;
private Integer maxNativeZoom;
private Number minZoom;
private Number maxZoom;
private Number minNativeZoom;
private Number maxNativeZoom;
private Boolean noWrap;
private String className;
private Integer keepBuffer;
private Number keepBuffer;

public Object getTileSize()
{
Expand All @@ -55,17 +55,17 @@ public S withTileSize(final Object tileSize)
return this.self();
}

public Double getOpacity()
public Number getOpacity()
{
return this.opacity;
}

public void setOpacity(final Double opacity)
public void setOpacity(final Number opacity)
{
this.opacity = opacity;
}

public S withOpacity(final Double opacity)
public S withOpacity(final Number opacity)
{
this.setOpacity(opacity);
return this.self();
Expand Down Expand Up @@ -103,33 +103,33 @@ public S withUpdateWhenZooming(final Boolean updateWhenZooming)
return this.self();
}

public Integer getUpdateInterval()
public Number getUpdateInterval()
{
return this.updateInterval;
}

public void setUpdateInterval(final Integer updateInterval)
public void setUpdateInterval(final Number updateInterval)
{
this.updateInterval = updateInterval;
}

public S withUpdateInterval(final Integer updateInterval)
public S withUpdateInterval(final Number updateInterval)
{
this.setUpdateInterval(updateInterval);
return this.self();
}

public Integer getzIndex()
public Number getzIndex()
{
return this.zIndex;
}

public void setzIndex(final Integer zIndex)
public void setzIndex(final Number zIndex)
{
this.zIndex = zIndex;
}

public S withZIndex(final Integer zIndex)
public S withZIndex(final Number zIndex)
{
this.setzIndex(zIndex);
return this.self();
Expand All @@ -151,65 +151,65 @@ public S withLatLngBounds(final LLatLngBounds latLngBounds)
return this.self();
}

public Integer getMinZoom()
public Number getMinZoom()
{
return this.minZoom;
}

public void setMinZoom(final Integer minZoom)
public void setMinZoom(final Number minZoom)
{
this.minZoom = minZoom;
}

public S withMinZoom(final Integer minZoom)
public S withMinZoom(final Number minZoom)
{
this.setMinZoom(minZoom);
return this.self();
}

public Integer getMaxZoom()
public Number getMaxZoom()
{
return this.maxZoom;
}

public void setMaxZoom(final Integer maxZoom)
public void setMaxZoom(final Number maxZoom)
{
this.maxZoom = maxZoom;
}

public S withMaxZoom(final Integer maxZoom)
public S withMaxZoom(final Number maxZoom)
{
this.setMaxZoom(maxZoom);
return this.self();
}

public Integer getMinNativeZoom()
public Number getMinNativeZoom()
{
return this.minNativeZoom;
}

public void setMinNativeZoom(final Integer minNativeZoom)
public void setMinNativeZoom(final Number minNativeZoom)
{
this.minNativeZoom = minNativeZoom;
}

public S withMinNativeZoom(final Integer minNativeZoom)
public S withMinNativeZoom(final Number minNativeZoom)
{
this.setMinNativeZoom(minNativeZoom);
return this.self();
}

public Integer getMaxNativeZoom()
public Number getMaxNativeZoom()
{
return this.maxNativeZoom;
}

public void setMaxNativeZoom(final Integer maxNativeZoom)
public void setMaxNativeZoom(final Number maxNativeZoom)
{
this.maxNativeZoom = maxNativeZoom;
}

public S withMaxNativeZoom(final Integer maxNativeZoom)
public S withMaxNativeZoom(final Number maxNativeZoom)
{
this.setMaxNativeZoom(maxNativeZoom);
return this.self();
Expand Down Expand Up @@ -247,17 +247,17 @@ public S withClassName(final String className)
return this.self();
}

public Integer getKeepBuffer()
public Number getKeepBuffer()
{
return this.keepBuffer;
}

public void setKeepBuffer(final Integer keepBuffer)
public void setKeepBuffer(final Number keepBuffer)
{
this.keepBuffer = keepBuffer;
}

public S withKeepBuffer(final Integer keepBuffer)
public S withKeepBuffer(final Number keepBuffer)
{
this.setKeepBuffer(keepBuffer);
return this.self();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
*/
public abstract class LLayerOptions<S extends LLayerOptions<S>> implements LComponentOptions<S>
{
String pane;
String attribution;
private String pane;
private String attribution;

public String getPane()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public abstract class LAbstractTileLayerOptions<S extends LAbstractTileLayerOpti
// String|String[]
private Object subdomains;
private String errorTileUrl;
private Integer zoomOffset;
private Number zoomOffset;
private Boolean tms;
private Boolean zoomReverse;
private Boolean detectRetina;
Expand Down Expand Up @@ -67,17 +67,17 @@ public S withErrorTileUrl(final String errorTileUrl)
return this.self();
}

public Integer getZoomOffset()
public Number getZoomOffset()
{
return this.zoomOffset;
}

public void setZoomOffset(final Integer zoomOffset)
public void setZoomOffset(final Number zoomOffset)
{
this.zoomOffset = zoomOffset;
}

public S withZoomOffset(final Integer zoomOffset)
public S withZoomOffset(final Number zoomOffset)
{
this.setZoomOffset(zoomOffset);
return this.self();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public LMarker(
/**
* @see <a href="https://leafletjs.com/reference.html#marker-setzindexoffset">Leaflet docs</a>
*/
public LMarker setZIndexOffset(final Integer offset)
public LMarker setZIndexOffset(final Number offset)
{
this.invokeSelf(".setZIndexOffset($0)", offset);
return this.self();
Expand Down
Loading

0 comments on commit f891b5e

Please sign in to comment.