Skip to content
Merged
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
2 changes: 1 addition & 1 deletion 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
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@
@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")
Comment thread
scardanzan marked this conversation as resolved.
Resolved
@JsModule("./googlemaps/geolocation.js")
@ExtensionMethod(value = JsonMigration.class, suppressBaseMethods = true)
public class GoogleMap extends Component implements HasSize {

private Integer trackLocationId = null;

private List<CustomControl> customControls = new ArrayList<>();

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

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Make this private field "final", it is never reassigned.

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

/** Base map types supported by Google Maps. */
public enum MapType {
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);
Comment thread
scardanzan marked this conversation as resolved.
Resolved
}
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 @@ -400,6 +432,10 @@
* Sets the mapId. See
* https://developers.google.com/maps/documentation/javascript/cloud-based-map-styling
*
* <p>The Map ID must be set before the map is shown: it's only read when the map is created, so
* setting it afterwards has no effect. Advanced markers ({@link GoogleMapAdvancedMarker}) require
* a Map ID.
*
* @param mapId If set, the custom style associated with that map id is applied.
*/
public void setMapId(String mapId) {
Expand Down Expand Up @@ -626,7 +662,7 @@
/** Event that is called when current location can't be found. */
public class GeolocationErrorEvent extends ComponentEvent<GoogleMap> {

private boolean browserHasGeolocationSupport;

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

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Make this private field "final", it is never reassigned.

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

public GeolocationErrorEvent(
GoogleMap source, boolean fromClient, boolean browserHasGeolocationSupport) {
Expand Down Expand Up @@ -919,7 +955,7 @@
*/
public static class FullScreenEvent extends ComponentEvent<GoogleMap> {

private boolean isFullScreen;

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

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Make this private field "final", it is never reassigned.

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

/**
* Creates a new FullScreenEvent.
Expand Down
Loading
Loading