Skip to content

Commit

Permalink
chore: add missing javadocs
Browse files Browse the repository at this point in the history
  • Loading branch information
paodb committed Mar 11, 2024
1 parent 3af40c7 commit 8dcb311
Showing 1 changed file with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,38 +148,72 @@ public GoogleMapMarker addMarker(
return gmm;
}

/**
* Creates a polygon with the given points and adds the new polygon to the map.
*
* @param points the points of the polygon
*
* @return the new created polygon
*/
public GoogleMapPolygon addPolygon(List<GoogleMapPoint> points) {
GoogleMapPolygon polygon = new GoogleMapPolygon(points);
addPolygon(polygon);
return polygon;
}

/**
* Adds a new polygon to the map.
*
* @param polygon the polygon to be added to the map
*/
public void addPolygon(GoogleMapPolygon polygon) {
this.getElement().appendChild(polygon.getElement());
if (this.getElement().getParent() != null) {
this.getElement().executeJs("this._updateObjects()");
}
}

/**
* Removes a polygon from the map.
*
* @param polygon the polygon to be removed from the map
*/
@SuppressWarnings("squid:S3242")
public void removePolygon(GoogleMapPolygon polygon) {
this.getElement().removeChild(polygon.getElement());
this.getElement().executeJs("this._updateObjects()");
}

/**
* Creates a polyline with the given points and adds the new polyline to the map.
*
* @param points the points of the polyline
*
* @return the new created polyline
*/
public GoogleMapPolyline addPolyline(List<GoogleMapPoint> points) {
GoogleMapPolyline polyline = new GoogleMapPolyline(points);
addPolyline(polyline);
return polyline;
}

/**
* Adds a new polyline to the map.
*
* @param polyline the polyline to be added to the map
*/
public void addPolyline(GoogleMapPolyline polyline) {
this.getElement().appendChild(polyline.getElement());
if (this.getElement().getParent() != null) {
this.getElement().executeJs("this._updateObjects()");
}
}

/**
* Removes a polyline from the map.
*
* @param polyline the polyline to be removed from the map
*/
@SuppressWarnings("squid:S3242")
public void removePolyline(GoogleMapPolyline polyline) {
this.getElement().removeChild(polyline.getElement());
Expand Down

0 comments on commit 8dcb311

Please sign in to comment.