@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.cjs CHANGED
@@ -6998,26 +6998,34 @@ const MapEditorCanvas = react.forwardRef(function MapEditorCanvas2({
6998
6998
  // Text features: center anchor; others: top anchor
6999
6999
  "text-anchor": ["case", ["==", ["get", "kind"], "text"], "center", "top"],
7000
7000
  "text-offset": ["case", ["==", ["get", "kind"], "text"], ["literal", [0, 0]], ["literal", [0, 0.8]]],
7001
- // Collision behaviour for entity labels.
7001
+ // Always allow overlap for every label this layer renders.
7002
7002
  //
7003
- // `kind === 'text'` features are sticky-note style annotations
7004
- // where the text IS the content (this layer has no icon-image,
7005
- // and `text-optional` cannot fall back to anything). If we let
7006
- // collision detection hide them, the user is left with a tiny
7007
- // 5px circle and no visible note. Same for trace endpoint
7008
- // labels — the label IS the meaningful marker.
7003
+ // The earlier `false` branch (for plain entity labels) was an
7004
+ // attempt to thin dense clusters via MapLibre's collision
7005
+ // detection. In practice it interacts poorly with this layer:
7009
7006
  //
7010
- // Plain entity-name labels are supplementary to the icon/dot,
7011
- // so it's safe to let MapLibre thin them out in dense areas
7012
- // (this is the "no more black mass of stacked labels" win).
7013
- "text-allow-overlap": [
7014
- "case",
7015
- ["==", ["get", "kind"], "text"],
7016
- true,
7017
- ["==", ["get", "isTraceLabel"], true],
7018
- true,
7019
- false
7020
- ],
7007
+ // - The `custom-labels` symbol layer has NO `icon-image`, so
7008
+ // `text-optional: true` cannot fall back to "show icon, drop
7009
+ // text". MapLibre instead drops the entire symbol when the
7010
+ // text loses collision.
7011
+ // - Vector basemaps (Streets / OSM Bright) place dense
7012
+ // city / POI / street labels everywhere, and our entity
7013
+ // label loses against ANY of them even at low zoom on an
7014
+ // otherwise-empty map. The PR that introduced collision
7015
+ // here only anticipated this happening "occasionally at
7016
+ // very high zoom", but the empirical behaviour is far more
7017
+ // aggressive.
7018
+ //
7019
+ // Net effect of the previous setting: a freshly dropped entity
7020
+ // point on an editable layer rendered NO label at all on most
7021
+ // basemaps, even with a single feature on the map.
7022
+ //
7023
+ // Reverting to unconditional `true` restores the previous
7024
+ // (working) behaviour. Stacking in dense clusters should be
7025
+ // addressed via a different mechanism (cluster/heatmap modes
7026
+ // already exist; per-zoom font-size or a host-supplied
7027
+ // collision opt-in are options if revisited).
7028
+ "text-allow-overlap": true,
7021
7029
  "text-ignore-placement": false,
7022
7030
  "text-optional": true,
7023
7031
  // Bold font for text features with fontWeight=bold, trace labels, others regular