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
41 changes: 18 additions & 23 deletions api/android-for-maplibre.api
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public final class com.mapconductor.maplibre.MapLibreMapViewKt {
public static final com.mapconductor.maplibre.MapLibreViewController createMapLibreViewController(com.mapconductor.maplibre.MapLibreMapViewHolderInterface, com.mapconductor.core.marker.MarkerTilingOptions, com.mapconductor.core.map.MutableMapServiceRegistry);
public static final com.mapconductor.maplibre.marker.MapLibreMarkerController getMarkerController(com.mapconductor.maplibre.MapLibreMapViewHolderInterface, com.mapconductor.core.marker.MarkerTilingOptions);
public static final com.mapconductor.maplibre.polyline.MapLibrePolylineController getPolylineController(com.mapconductor.maplibre.MapLibreMapViewHolderInterface);
public static final com.mapconductor.maplibre.polygon.MapLibrePolygonConductor getPolygonController(com.mapconductor.maplibre.MapLibreMapViewHolderInterface);
public static final com.mapconductor.maplibre.polygon.MapLibrePolygonController getPolygonController(com.mapconductor.maplibre.MapLibreMapViewHolderInterface);
public static final com.mapconductor.maplibre.circle.MapLibreCircleController getCircleController(com.mapconductor.maplibre.MapLibreMapViewHolderInterface);
public static final com.mapconductor.maplibre.raster.MapLibreRasterLayerController getRasterLayerController(com.mapconductor.maplibre.MapLibreMapViewHolderInterface);
public static final com.mapconductor.maplibre.groundimage.MapLibreGroundImageController getGroundImageController(com.mapconductor.maplibre.MapLibreMapViewHolderInterface);
Expand All @@ -109,8 +109,8 @@ public final class com.mapconductor.maplibre.MapLibrePolyUtilsKt {
public final class com.mapconductor.maplibre.MapLibreTypeAliasKt {
}
public final class com.mapconductor.maplibre.MapLibreViewController extends com.mapconductor.core.controller.BaseMapViewController implements com.mapconductor.maplibre.MapLibreViewControllerInterface,org.maplibre.android.maps.MapLibreMap$OnMapClickListener,org.maplibre.android.maps.MapLibreMap$OnMapLongClickListener,org.maplibre.android.maps.MapLibreMap$OnMoveListener,org.maplibre.android.maps.MapLibreMap$OnCameraMoveListener,org.maplibre.android.maps.MapLibreMap$OnCameraIdleListener {
public com.mapconductor.maplibre.MapLibreViewController(com.mapconductor.maplibre.MapLibreMapViewHolderInterface, com.mapconductor.maplibre.marker.MapLibreMarkerController, com.mapconductor.maplibre.polyline.MapLibrePolylineController, com.mapconductor.maplibre.polygon.MapLibrePolygonConductor, com.mapconductor.maplibre.groundimage.MapLibreGroundImageController, com.mapconductor.maplibre.circle.MapLibreCircleController, com.mapconductor.maplibre.raster.MapLibreRasterLayerController, kotlinx.coroutines.CoroutineScope, kotlinx.coroutines.CoroutineScope);
public com.mapconductor.maplibre.MapLibreViewController(com.mapconductor.maplibre.MapLibreMapViewHolderInterface, com.mapconductor.maplibre.marker.MapLibreMarkerController, com.mapconductor.maplibre.polyline.MapLibrePolylineController, com.mapconductor.maplibre.polygon.MapLibrePolygonConductor, com.mapconductor.maplibre.groundimage.MapLibreGroundImageController, com.mapconductor.maplibre.circle.MapLibreCircleController, com.mapconductor.maplibre.raster.MapLibreRasterLayerController, kotlinx.coroutines.CoroutineScope, kotlinx.coroutines.CoroutineScope, int, kotlin.jvm.internal.DefaultConstructorMarker);
public com.mapconductor.maplibre.MapLibreViewController(com.mapconductor.maplibre.MapLibreMapViewHolderInterface, com.mapconductor.maplibre.marker.MapLibreMarkerController, com.mapconductor.maplibre.polyline.MapLibrePolylineController, com.mapconductor.maplibre.polygon.MapLibrePolygonController, com.mapconductor.maplibre.groundimage.MapLibreGroundImageController, com.mapconductor.maplibre.circle.MapLibreCircleController, com.mapconductor.maplibre.raster.MapLibreRasterLayerController, kotlinx.coroutines.CoroutineScope, kotlinx.coroutines.CoroutineScope);
public com.mapconductor.maplibre.MapLibreViewController(com.mapconductor.maplibre.MapLibreMapViewHolderInterface, com.mapconductor.maplibre.marker.MapLibreMarkerController, com.mapconductor.maplibre.polyline.MapLibrePolylineController, com.mapconductor.maplibre.polygon.MapLibrePolygonController, com.mapconductor.maplibre.groundimage.MapLibreGroundImageController, com.mapconductor.maplibre.circle.MapLibreCircleController, com.mapconductor.maplibre.raster.MapLibreRasterLayerController, kotlinx.coroutines.CoroutineScope, kotlinx.coroutines.CoroutineScope, int, kotlin.jvm.internal.DefaultConstructorMarker);
public com.mapconductor.maplibre.MapLibreMapViewHolderInterface getHolder();
public kotlinx.coroutines.CoroutineScope getMainCoroutine();
public kotlinx.coroutines.CoroutineScope getDefaultCoroutine();
Expand Down Expand Up @@ -358,27 +358,22 @@ public class com.mapconductor.maplibre.marker.MarkerLayer {
public final boolean wouldSkipDraw(java.util.List<? extends com.mapconductor.core.marker.MarkerEntityInterface<org.maplibre.geojson.Feature>>);
public final void draw(java.util.List<? extends com.mapconductor.core.marker.MarkerEntityInterface<org.maplibre.geojson.Feature>>, org.maplibre.android.maps.Style);
}
public final class com.mapconductor.maplibre.polygon.MapLibrePolygonConductor implements com.mapconductor.core.controller.SlottedOverlayController<com.mapconductor.core.polygon.PolygonState, com.mapconductor.core.polygon.PolygonEntityInterface<com.mapconductor.core.polygon.PolygonState>> {
public com.mapconductor.maplibre.polygon.MapLibrePolygonConductor(com.mapconductor.maplibre.polygon.MapLibrePolygonOverlayRenderer, com.mapconductor.maplibre.polyline.MapLibrePolylineOverlayRenderer);
public final com.mapconductor.maplibre.polygon.MapLibrePolygonOverlayRenderer getPolygonOverlay();
public final com.mapconductor.maplibre.polyline.MapLibrePolylineOverlayRenderer getPolylineOverlay();
public int getZIndex();
public final kotlin.jvm.functions.Function1<com.mapconductor.core.polygon.PolygonEvent, kotlin.Unit> getClickListener();
public final void setClickListener(kotlin.jvm.functions.Function1<? super com.mapconductor.core.polygon.PolygonEvent, kotlin.Unit>);
public java.lang.Object add(java.util.List<com.mapconductor.core.polygon.PolygonState>, kotlin.coroutines.Continuation<? super kotlin.Unit>);
public java.lang.Object update(com.mapconductor.core.polygon.PolygonState, kotlin.coroutines.Continuation<? super kotlin.Unit>);
public final void dispatchClick(com.mapconductor.core.polygon.PolygonEvent);
public com.mapconductor.core.polygon.PolygonEntityInterface<com.mapconductor.core.polygon.PolygonState> find(com.mapconductor.core.features.GeoPointInterface);
public java.lang.Object clear(kotlin.coroutines.Continuation<? super kotlin.Unit>);
public com.mapconductor.core.controller.OverlayKind getKind();
public boolean has(java.lang.String);
public void setClickListenerAny(java.lang.Object);
public com.mapconductor.core.controller.OverlayHit resolveTap(com.mapconductor.core.features.GeoPointInterface);
public void destroy();
public java.lang.Object update(java.lang.Object, kotlin.coroutines.Continuation);
public java.lang.Object find(com.mapconductor.core.features.GeoPointInterface);
public final class com.mapconductor.maplibre.polygon.MapLibrePolygonCompositeRenderer implements com.mapconductor.core.polygon.PolygonOverlayRendererInterface<java.util.List<? extends org.maplibre.geojson.Feature>> {
public com.mapconductor.maplibre.polygon.MapLibrePolygonCompositeRenderer(com.mapconductor.maplibre.polygon.MapLibrePolygonOverlayRenderer, com.mapconductor.maplibre.polyline.MapLibrePolylineOverlayRenderer);
public final com.mapconductor.maplibre.polygon.MapLibrePolygonOverlayRenderer getFill();
public final com.mapconductor.maplibre.polyline.MapLibrePolylineOverlayRenderer getOutline();
public java.lang.Object onAdd(java.util.List<? extends com.mapconductor.core.polygon.PolygonOverlayRendererInterface$AddParamsInterface>, kotlin.coroutines.Continuation<? super java.util.List<? extends java.util.List<org.maplibre.geojson.Feature>>>);
public java.lang.Object onChange(java.util.List<? extends com.mapconductor.core.polygon.PolygonOverlayRendererInterface$ChangeParamsInterface<java.util.List<org.maplibre.geojson.Feature>>>, kotlin.coroutines.Continuation<? super java.util.List<? extends java.util.List<org.maplibre.geojson.Feature>>>);
public java.lang.Object onRemove(java.util.List<? extends com.mapconductor.core.polygon.PolygonEntityInterface<java.util.List<org.maplibre.geojson.Feature>>>, kotlin.coroutines.Continuation<? super kotlin.Unit>);
public java.lang.Object onPostProcess(kotlin.coroutines.Continuation<? super kotlin.Unit>);
}
public final class com.mapconductor.maplibre.polygon.MapLibrePolygonConductorKt {
public final class com.mapconductor.maplibre.polygon.MapLibrePolygonCompositeRendererKt {
}
public final class com.mapconductor.maplibre.polygon.MapLibrePolygonController extends com.mapconductor.core.polygon.PolygonController<java.util.List<? extends org.maplibre.geojson.Feature>> {
public com.mapconductor.maplibre.polygon.MapLibrePolygonController(com.mapconductor.maplibre.polygon.MapLibrePolygonCompositeRenderer);
public com.mapconductor.maplibre.polygon.MapLibrePolygonCompositeRenderer getRenderer();
public int getZIndex();
public com.mapconductor.core.polygon.PolygonOverlayRendererInterface getRenderer();
}
public final class com.mapconductor.maplibre.polygon.MapLibrePolygonLayer {
public com.mapconductor.maplibre.polygon.MapLibrePolygonLayer(java.lang.String, java.lang.String);
Expand Down
4 changes: 2 additions & 2 deletions docs/MapLibreViewControllerImpl.kt.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class MapLibreViewController(
override val holder: MapLibreMapViewHolderInterface,
private val markerController: MapLibreMarkerController,
private val polylineController: MapLibrePolylineController,
private val polygonController: MapLibrePolygonConductor,
private val polygonController: MapLibrePolygonController,
private val groundImageController: MapLibreGroundImageController,
private val circleController: MapLibreCircleController,
private val rasterLayerController: MapLibreRasterLayerController,
Expand All @@ -39,7 +39,7 @@ Initializes a new instance of the `MapLibreViewController`.
- Type: `MapLibrePolylineController`
- Description: The controller responsible for managing polylines.
- `polygonController`
- Type: `MapLibrePolygonConductor`
- Type: `MapLibrePolygonController`
- Description: The controller responsible for managing polygons.
- `groundImageController`
- Type: `MapLibreGroundImageController`
Expand Down
37 changes: 37 additions & 0 deletions docs/polygon/MapLibrePolygonCompositeRenderer.kt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# MapLibrePolygonCompositeRenderer

## Signature

```kotlin
class MapLibrePolygonCompositeRenderer(
val fill: MapLibrePolygonOverlayRenderer,
val outline: MapLibrePolylineOverlayRenderer,
) : PolygonOverlayRendererInterface<MapLibreActualPolygon>
```

## Description

Presents the fill renderer and the outline renderer to the core `PolygonController` as a single
renderer.

A MapLibre fill layer can only draw a 1 px outline with no width, so to honour `strokeWidth` each
polygon's outer ring is also drawn as a closed polyline with the id `outline-<polygon id>` through
`outline`. Every call the controller makes on this renderer is forwarded to `fill` and mirrored on
`outline`:

- `onAdd` / `onChange`: the fill is created or rebuilt; when that succeeds, the outline polyline is
(re)created with the polygon's `strokeColor`, `strokeWidth`, `geodesic`, `zIndex` and `extra`.
- `onRemove`: the outline polylines are dropped and both sources are redrawn without the removed
polygons (the controller's `clear()` does not call `onPostProcess`).
- `onPostProcess`: both sources are redrawn.

Holes are not outlined.

## Constructor Parameters

- `fill`
- Type: `MapLibrePolygonOverlayRenderer`
- Description: Draws the polygon fill (with holes) into the fill source.
- `outline`
- Type: `MapLibrePolylineOverlayRenderer`
- Description: Draws the outlines into the polygon outline source.
244 changes: 0 additions & 244 deletions docs/polygon/MapLibrePolygonConductor.kt.md

This file was deleted.

30 changes: 30 additions & 0 deletions docs/polygon/MapLibrePolygonController.kt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# MapLibrePolygonController

## Signature

```kotlin
class MapLibrePolygonController(
override val renderer: MapLibrePolygonCompositeRenderer,
) : PolygonController<MapLibreActualPolygon>(renderer.fill.polygonManager, renderer)
```

## Description

The polygon controller of the MapLibre provider. It extends the core `PolygonController`, so diffing
(add / change / remove), `has`, `find`, the click cascade (`resolveTap`, `dispatchClick`),
`clear` and `destroy` are the core implementation shared with every other provider.

The only provider-specific part is the renderer: a fill layer can only draw a 1 px outline, so the
outline is drawn as a separate polyline by [`MapLibrePolygonCompositeRenderer`](./MapLibrePolygonCompositeRenderer.kt.md).

## Constructor Parameters

- `renderer`
- Type: `MapLibrePolygonCompositeRenderer`
- Description: Draws both the fill and the outline. Its `fill.polygonManager` is used as the
controller's polygon manager, so the controller and the fill renderer always see the same
entities.

## Properties

- `zIndex`: `2` (unchanged from the former `MapLibrePolygonConductor`).
Loading
Loading