Skip to content

Commit

Permalink
feat: add custom renderer to marker clustering
Browse files Browse the repository at this point in the history
Close #103
  • Loading branch information
paodb committed Sep 21, 2023
1 parent ae7f91f commit 2f3dd8b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
@SuppressWarnings("serial")
@Tag("google-map")
@JsModule("@flowingcode/google-map/google-map.js")
@NpmPackage(value = "@flowingcode/google-map", version = "3.4.0")
@NpmPackage(value = "@flowingcode/google-map", version = "3.5.0")
@NpmPackage(value = "@googlemaps/markerclusterer", version = "2.0.8")
@JsModule("./googlemaps/geolocation.js")
public class GoogleMap extends Component implements HasSize {
Expand Down Expand Up @@ -541,4 +541,14 @@ public CompletableFuture<LatLonBounds> getBounds() {
return new LatLonBounds(result);
});
}

/**
* Sets the custom renderer definition to be applied to the markers clustering. The custom
* renderer needs to be define as a global JavaScript function that has "render" as its name.
*
* @param customRenderer the custom renderer definition
*/
public void setClusteringRenderer(String customRenderer) {
this.getElement().setProperty("customRenderer", customRenderer);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
@SuppressWarnings("serial")
@Tag("google-map-marker")
@JsModule("@flowingcode/google-map/google-map-marker.js")
@NpmPackage(value = "@flowingcode/google-map", version = "3.4.0")
@NpmPackage(value = "@flowingcode/google-map", version = "3.5.0")
@NpmPackage(value = "@googlemaps/markerclusterer", version = "2.0.8")
public class GoogleMapMarker extends Component {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
@SuppressWarnings("serial")
@Tag("google-map-point")
@JsModule("@flowingcode/google-map/google-map-point.js")
@NpmPackage(value = "@flowingcode/google-map", version = "3.4.0")
@NpmPackage(value = "@flowingcode/google-map", version = "3.5.0")
@NpmPackage(value = "@googlemaps/markerclusterer", version = "2.0.8")
public class GoogleMapPoint extends Component {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
@Tag("google-map-poly")
@JsModule("@flowingcode/google-map/google-map-poly.js")
@JsModule("@flowingcode/google-map/google-map-point.js")
@NpmPackage(value = "@flowingcode/google-map", version = "3.4.0")
@NpmPackage(value = "@flowingcode/google-map", version = "3.5.0")
@NpmPackage(value = "@googlemaps/markerclusterer", version = "2.0.8")
public class GoogleMapPolygon extends Component {

Expand Down

0 comments on commit 2f3dd8b

Please sign in to comment.