@octostar/map-component 0.1.29 → 0.1.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -6977,26 +6977,34 @@ const MapEditorCanvas = forwardRef(function MapEditorCanvas2({
6977
6977
  // Text features: center anchor; others: top anchor
6978
6978
  "text-anchor": ["case", ["==", ["get", "kind"], "text"], "center", "top"],
6979
6979
  "text-offset": ["case", ["==", ["get", "kind"], "text"], ["literal", [0, 0]], ["literal", [0, 0.8]]],
6980
- // Collision behaviour for entity labels.
6980
+ // Always allow overlap for every label this layer renders.
6981
6981
  //
6982
- // `kind === 'text'` features are sticky-note style annotations
6983
- // where the text IS the content (this layer has no icon-image,
6984
- // and `text-optional` cannot fall back to anything). If we let
6985
- // collision detection hide them, the user is left with a tiny
6986
- // 5px circle and no visible note. Same for trace endpoint
6987
- // labels — the label IS the meaningful marker.
6982
+ // The earlier `false` branch (for plain entity labels) was an
6983
+ // attempt to thin dense clusters via MapLibre's collision
6984
+ // detection. In practice it interacts poorly with this layer:
6988
6985
  //
6989
- // Plain entity-name labels are supplementary to the icon/dot,
6990
- // so it's safe to let MapLibre thin them out in dense areas
6991
- // (this is the "no more black mass of stacked labels" win).
6992
- "text-allow-overlap": [
6993
- "case",
6994
- ["==", ["get", "kind"], "text"],
6995
- true,
6996
- ["==", ["get", "isTraceLabel"], true],
6997
- true,
6998
- false
6999
- ],
6986
+ // - The `custom-labels` symbol layer has NO `icon-image`, so
6987
+ // `text-optional: true` cannot fall back to "show icon, drop
6988
+ // text". MapLibre instead drops the entire symbol when the
6989
+ // text loses collision.
6990
+ // - Vector basemaps (Streets / OSM Bright) place dense
6991
+ // city / POI / street labels everywhere, and our entity
6992
+ // label loses against ANY of them even at low zoom on an
6993
+ // otherwise-empty map. The PR that introduced collision
6994
+ // here only anticipated this happening "occasionally at
6995
+ // very high zoom", but the empirical behaviour is far more
6996
+ // aggressive.
6997
+ //
6998
+ // Net effect of the previous setting: a freshly dropped entity
6999
+ // point on an editable layer rendered NO label at all on most
7000
+ // basemaps, even with a single feature on the map.
7001
+ //
7002
+ // Reverting to unconditional `true` restores the previous
7003
+ // (working) behaviour. Stacking in dense clusters should be
7004
+ // addressed via a different mechanism (cluster/heatmap modes
7005
+ // already exist; per-zoom font-size or a host-supplied
7006
+ // collision opt-in are options if revisited).
7007
+ "text-allow-overlap": true,
7000
7008
  "text-ignore-placement": false,
7001
7009
  "text-optional": true,
7002
7010
  // Bold font for text features with fontWeight=bold, trace labels, others regular