From c260d293acbddbc1ca6c4c1ac933c396ed34a045 Mon Sep 17 00:00:00 2001 From: Masashi Katsumata Date: Sat, 7 Nov 2026 21:47:37 -0800 Subject: [PATCH 1/2] Interpolate the closing edge of geodesic polygons ring(_:geodesic:) densified a geodesic ring with createInterpolatePoints, which only interpolates between neighbouring points. Rings arrive open, so the closing edge (last vertex -> first) stayed a straight chord in both fill and outline (Boston -> London -> Iceland: the Iceland -> Boston edge). Use ios-sdk-core's densifyGeodesicRing. geodesic=false is unchanged. Requires the ios-sdk-core release that adds densifyGeodesicRing. --- .../polygon/MapKitPolygonOverlayRenderer.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Sources/MapConductorForMapKit/polygon/MapKitPolygonOverlayRenderer.swift b/Sources/MapConductorForMapKit/polygon/MapKitPolygonOverlayRenderer.swift index 65e4726..b8542e6 100644 --- a/Sources/MapConductorForMapKit/polygon/MapKitPolygonOverlayRenderer.swift +++ b/Sources/MapConductorForMapKit/polygon/MapKitPolygonOverlayRenderer.swift @@ -132,8 +132,9 @@ final class MapKitPolygonOverlayRenderer: AbstractPolygonOverlayRenderer [CLLocationCoordinate2D] { + // geodesic は閉じる辺(末尾 → 先頭)も大圏で補間する(塗りと輪郭が同じ MKPolygon)。 let geoPoints: [GeoPointProtocol] = geodesic - ? WGS84Geodesic.createInterpolatePoints(points) + ? densifyGeodesicRing(points) : Planar.createInterpolatePoints(points) return geoPoints.map { CLLocationCoordinate2D(latitude: $0.latitude, longitude: $0.longitude) } } From a195afa23c19a0766f2c6f31469daa0fc64b958b Mon Sep 17 00:00:00 2001 From: Masashi Katsumata Date: Sat, 7 Nov 2026 23:26:58 -0800 Subject: [PATCH 2/2] Densify the closing edge of non-geodesic polygons too A geodesic=false ring went through Planar.createInterpolatePoints, which only interpolates between neighbouring points, so the closing edge (last vertex -> first) stayed one straight Web Mercator segment while the other edges - and polylines with geodesic=false - follow linear lat/lng interpolation. Use ios-sdk-core's densifyPolygonRing for both modes (it replaces the unreleased densifyGeodesicRing). Requires the ios-sdk-core release that adds densifyPolygonRing. --- .../polygon/MapKitPolygonOverlayRenderer.swift | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Sources/MapConductorForMapKit/polygon/MapKitPolygonOverlayRenderer.swift b/Sources/MapConductorForMapKit/polygon/MapKitPolygonOverlayRenderer.swift index b8542e6..414d807 100644 --- a/Sources/MapConductorForMapKit/polygon/MapKitPolygonOverlayRenderer.swift +++ b/Sources/MapConductorForMapKit/polygon/MapKitPolygonOverlayRenderer.swift @@ -132,11 +132,9 @@ final class MapKitPolygonOverlayRenderer: AbstractPolygonOverlayRenderer [CLLocationCoordinate2D] { - // geodesic は閉じる辺(末尾 → 先頭)も大圏で補間する(塗りと輪郭が同じ MKPolygon)。 - let geoPoints: [GeoPointProtocol] = geodesic - ? densifyGeodesicRing(points) - : Planar.createInterpolatePoints(points) - return geoPoints.map { CLLocationCoordinate2D(latitude: $0.latitude, longitude: $0.longitude) } + // 閉じる辺(末尾 → 先頭)も他の辺と同じく補間する(塗りと輪郭が同じ MKPolygon)。 + // geodesic は大圏、geodesic=false は緯度経度の線形補間(ポリラインの false と同じ線)。 + densifyPolygonRing(points, geodesic: geodesic).map { CLLocationCoordinate2D(latitude: $0.latitude, longitude: $0.longitude) } } }