From c2fb5b667975a16b971545f955453ef0d702c498 Mon Sep 17 00:00:00 2001 From: Masashi Katsumata Date: Sat, 7 Nov 2026 21:16:13 -0800 Subject: [PATCH 1/2] Interpolate the closing edge of geodesic polygon rings The polygon rings went through densifyAndNormalize, which only interpolates between neighbouring points, so a geodesic polygon's closing edge (last vertex -> first) was a straight chord in both fill and outline. Use js-sdk-core's densifyGeodesicRing for geodesic rings. geodesic=false is unchanged. Requires the js-sdk-core release that adds densifyGeodesicRing. --- src/polygon/HerePolygonOverlayRenderer.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/polygon/HerePolygonOverlayRenderer.ts b/src/polygon/HerePolygonOverlayRenderer.ts index 5be32a7..4911a88 100644 --- a/src/polygon/HerePolygonOverlayRenderer.ts +++ b/src/polygon/HerePolygonOverlayRenderer.ts @@ -10,6 +10,7 @@ import { AbstractPolygonOverlayRenderer, densifyAndNormalize, + densifyGeodesicRing, type PolygonEntity, type PolygonState, } from '@mapconductor/js-sdk-core'; @@ -98,7 +99,11 @@ function buildLineString( // Core pipeline: densify (great-circle when geodesic, linear lat/lng // otherwise — Android's straight-line semantics) and normalize into HERE's // [-180, 180] longitude range. - for (const point of densifyAndNormalize(points, geodesic)) { + // geodesic はリングの閉じる辺(末尾 → 先頭)も大圏で補間する(輪郭と同じ曲線にする)。 + const ring = geodesic + ? densifyGeodesicRing(points).map((point) => point.normalize()) + : densifyAndNormalize(points, false); + for (const point of ring) { lineString.pushPoint(toGeoCoordinates(point)); } return lineString; From d68dd6bafa769e6cfec3b84a028bf11ff03d7801 Mon Sep 17 00:00:00 2001 From: Masashi Katsumata Date: Sat, 7 Nov 2026 23:33:21 -0800 Subject: [PATCH 2/2] Densify the closing edge of non-geodesic polygon rings too A geodesic=false ring went through densifyAndNormalize, which only interpolates between neighbouring points, so the closing edge (last vertex -> first) stayed one straight Web Mercator segment in both fill and outline, while the other edges - and polylines with geodesic=false - follow linear lat/lng interpolation. Use js-sdk-core's densifyPolygonRing for both modes (it replaces the unreleased densifyGeodesicRing). Requires the js-sdk-core release that adds densifyPolygonRing. --- src/polygon/HerePolygonOverlayRenderer.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/polygon/HerePolygonOverlayRenderer.ts b/src/polygon/HerePolygonOverlayRenderer.ts index 4911a88..492bfbd 100644 --- a/src/polygon/HerePolygonOverlayRenderer.ts +++ b/src/polygon/HerePolygonOverlayRenderer.ts @@ -9,8 +9,7 @@ */ import { AbstractPolygonOverlayRenderer, - densifyAndNormalize, - densifyGeodesicRing, + densifyPolygonRing, type PolygonEntity, type PolygonState, } from '@mapconductor/js-sdk-core'; @@ -99,10 +98,8 @@ function buildLineString( // Core pipeline: densify (great-circle when geodesic, linear lat/lng // otherwise — Android's straight-line semantics) and normalize into HERE's // [-180, 180] longitude range. - // geodesic はリングの閉じる辺(末尾 → 先頭)も大圏で補間する(輪郭と同じ曲線にする)。 - const ring = geodesic - ? densifyGeodesicRing(points).map((point) => point.normalize()) - : densifyAndNormalize(points, false); + // リングの閉じる辺(末尾 → 先頭)も他の辺と同じく補間する(輪郭と同じ線にする)。 + const ring = densifyPolygonRing(points, geodesic).map((point) => point.normalize()); for (const point of ring) { lineString.pushPoint(toGeoCoordinates(point)); }