Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.flowingcode.vaadin.addons</groupId>
<artifactId>google-maps</artifactId>
<version>2.6.1-SNAPSHOT</version>
<version>2.7.0-SNAPSHOT</version>
<name>Google Maps Addon</name>
<description>Integration of google-map for Vaadin platform</description>

Expand Down Expand Up @@ -559,7 +559,7 @@
<maven.compiler.target>21</maven.compiler.target>
<vaadin.version>25.0.0</vaadin.version>
<jetty.version>11.0.26</jetty.version>
<flowingcode.commons.demo.version>5.2.0</flowingcode.commons.demo.version>
<flowingcode.commons.demo.version>5.5.0</flowingcode.commons.demo.version>
</properties>
<dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
@SuppressWarnings("serial")
@Tag("google-map")
@JsModule("@flowingcode/google-map/google-map.js")
@NpmPackage(value = "@flowingcode/google-map", version = "3.9.0")
@NpmPackage(value = "@googlemaps/markerclusterer", version = "2.0.8")
@NpmPackage(value = "@flowingcode/google-map", version = "3.10.1")
@NpmPackage(value = "@googlemaps/markerclusterer", version = "2.6.2")
@JsModule("./googlemaps/geolocation.js")
@ExtensionMethod(value = JsonMigration.class, suppressBaseMethods = true)
public class GoogleMap extends Component implements HasSize {
Expand Down Expand Up @@ -259,7 +259,7 @@
public void addMarker(GoogleMapMarker marker) {
getElement().appendChild(marker.getElement());
if (getElement().getParent() != null) {
getElement().executeJs("this._updateMarkers()");

Check failure on line 262 in src/main/java/com/flowingcode/vaadin/addons/googlemaps/GoogleMap.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Define a constant instead of duplicating this literal "this._updateMarkers()" 4 times.

See more on https://sonarcloud.io/project/issues?id=FlowingCode_GoogleMapsAddon&issues=AaE8pWrGsd5hDD6eAbpG&open=AaE8pWrGsd5hDD6eAbpG&pullRequest=186
}
}

Expand All @@ -270,6 +270,38 @@
getElement().executeJs("this._updateMarkers()");
}

/**
* Adds an advanced marker to the map. Advanced markers require the map to have a Map ID (see
* {@link #setMapId(String)}), set before the map is shown.
*
* @param marker The marker to add.
* @throws IllegalStateException if the map is already shown and has no Map ID
* @since 2.7.0
*/
public void addMarker(GoogleMapAdvancedMarker marker) {
if (isAttached()) {
// checked before adding the marker, so that it isn't left in the map on failure
GoogleMapAdvancedMarker.checkMapId(this);
}
getElement().appendChild(marker.getElement());
if (getElement().getParent() != null) {
getElement().executeJs("this._updateMarkers()");
}
}

/**
* Removes an advanced marker from the map.
*
* @param marker The marker to remove.
* @since 2.7.0
*/
@SuppressWarnings("squid:S3242")
public void removeMarker(GoogleMapAdvancedMarker marker) {
getElement().removeChild(marker.getElement());
// markers need to be updated on removal
getElement().executeJs("this._updateMarkers()");
}

/**
* Sets the type of the base map.
*
Expand Down Expand Up @@ -814,7 +846,7 @@

private final LatLonBounds bounds;

public GoogleMapBoundsChangedEvent(GoogleMap source, boolean fromClient,

Check warning on line 849 in src/main/java/com/flowingcode/vaadin/addons/googlemaps/GoogleMap.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this unused method parameter "fromClient".

See more on https://sonarcloud.io/project/issues?id=FlowingCode_GoogleMapsAddon&issues=AaE8pWrGsd5hDD6eAbpH&open=AaE8pWrGsd5hDD6eAbpH&pullRequest=186
LatLonBounds latLonBounds) {
super(source, true);
bounds = latLonBounds;
Expand Down
Loading
Loading