ofs-object 0.1.5 → 0.1.7

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/README.md CHANGED
@@ -302,6 +302,10 @@ initMap();
302
302
  </script>
303
303
  ```
304
304
 
305
+ > `mount()` ตกแต่งหน้าตาของ console อย่างเดียว **ไม่จัดตำแหน่งให้** — วาง element `console-mount` ตาม layout
306
+ > ของหน้าเอง หรือใส่ class `ofs-console-floating` ให้ลอยชิดล่างของ parent ที่ `position: relative`
307
+ > (ก่อน 0.1.6 ไลบรารีบังคับ `position: absolute; left: 80px; right: 420px` ซึ่งเป็นขนาดของ playground)
308
+
305
309
  ---
306
310
 
307
311
  ### React
package/dist/index.d.ts CHANGED
@@ -366,7 +366,17 @@ export declare abstract class BaseGLAdapter implements IMapAdapter {
366
366
  protected setupMapEventListeners(): void;
367
367
  /** undefined = not worked out yet for the current style */
368
368
  private styleFontCache;
369
+ /**
370
+ * Font for text when the basemap names none - a satellite or OSM raster basemap has no labels to
371
+ * read one from. It must exist on the style's glyph server. null leaves the engine default
372
+ * ("Open Sans Regular"), which many glyph servers do not have.
373
+ */
374
+ private fallbackFont;
375
+ /** Set before `init()` / `attach()` to apply everywhere; set later, labels already drawn are redone */
376
+ setFallbackFont(font: string[] | null): void;
377
+ /** The basemap's own label font; else the fallback font; else null */
369
378
  getStyleFont(): string[] | null;
379
+ private readStyleFont;
370
380
  getRawMap<T = any>(): T;
371
381
  /**
372
382
  * Take every source and layer this adapter added off a map it does not own, so the host is
@@ -593,6 +603,8 @@ export declare interface CategoricalFieldStats {
593
603
  export declare interface CategoricalThemeOptions {
594
604
  reverse?: boolean;
595
605
  baseSymbol?: SymbolStyleInput;
606
+ /** Keep categories that no feature has any more when reclassifying (see ThematicDefinition) */
607
+ keepEmptyCategories?: boolean;
596
608
  }
597
609
 
598
610
  /**
@@ -1779,10 +1791,12 @@ export declare interface IMapAdapter {
1779
1791
  getRawMap<T = any>(): T;
1780
1792
  /**
1781
1793
  * The glyph font stack the basemap's own labels use, so text added on top is drawn in a font its
1782
- * glyph server has. Null when the style names none. Optional: an adapter without it gets the
1783
- * engine default font.
1794
+ * glyph server has; when the style names none (a raster basemap), the fallback font; else null.
1795
+ * Optional: an adapter without it gets the engine default font.
1784
1796
  */
1785
1797
  getStyleFont?(): string[] | null;
1798
+ /** Font to use when the basemap names none; it must exist on the style's glyph server */
1799
+ setFallbackFont?(font: string[] | null): void;
1786
1800
  /** Cleanup */
1787
1801
  destroy(): void;
1788
1802
  }
@@ -2903,7 +2917,7 @@ export declare class OFSDataSource extends TypedEventEmitter<OFSDataSourceEvents
2903
2917
  setLayerGroupVisibility(groupId: string, visible: boolean): void;
2904
2918
  /** Move a layer into a group (null = top level) */
2905
2919
  moveLayerToGroup(layerId: string, groupId: string | null): void;
2906
- /** True when the layer is inside the group, directly or through sub-groups */
2920
+ /** True when the layer (of either kind) is inside the group, directly or through sub-groups */
2907
2921
  isLayerInGroup(layerId: string, groupId: string): boolean;
2908
2922
  /** A layer of either kind is drawn when it and all of its parent groups are visible */
2909
2923
  isLayerRendered(layerId: string): boolean;
@@ -3633,6 +3647,11 @@ export declare class OFSDrawTools extends TypedEventEmitter<DrawEvents> {
3633
3647
  * Render real-time preview of drag box marquee selection
3634
3648
  */
3635
3649
  private updateDragBoxPreview;
3650
+ /**
3651
+ * Features under the pointer that select / modify may pick - only the target layer's when
3652
+ * `setMode('select', layerId)` named one (the same rule as box / polygon selection)
3653
+ */
3654
+ private pickable;
3636
3655
  /**
3637
3656
  * Query all features within or intersecting the given geometry across visible layers
3638
3657
  */
@@ -3954,8 +3973,14 @@ export declare class OFSLegendTools extends TypedEventEmitter<LegendEvents> {
3954
3973
  * Notify subscribers of a state change
3955
3974
  */
3956
3975
  notifyUpdate(): void;
3976
+ /** A legend row of either kind: a feature layer or a tile layer */
3977
+ private findRow;
3957
3978
  toggleLayerVisibility(layerId: string): void;
3958
3979
  setLayerOpacity(layerId: string, opacity: number): void;
3980
+ /**
3981
+ * Make a layer the one new features go into. A tile layer cannot hold features, so choosing one -
3982
+ * clicking a basemap row in the legend, say - is ignored rather than an error.
3983
+ */
3959
3984
  setActiveLayer(layerId: string): void;
3960
3985
  toggleLayerPinned(layerId: string): void;
3961
3986
  /** Move a layer one place up among its siblings in the legend tree (above a sibling group as a whole) */
@@ -4111,6 +4136,12 @@ export declare interface OFSObjectConfig {
4111
4136
  * with `consoleWidget.submit(text)` and render the `console:line` / `console:prompt` events.
4112
4137
  */
4113
4138
  console?: IOFSConsole;
4139
+ /**
4140
+ * Font for labels and drawing guides when the basemap has no labels to take one from - satellite
4141
+ * imagery, OSM raster tiles. It must exist on the style's glyph server, e.g. `['Noto Sans Regular']`
4142
+ * for OpenFreeMap. A basemap that has labels still wins: its font is known to exist.
4143
+ */
4144
+ fallbackFont?: string[];
4114
4145
  }
4115
4146
 
4116
4147
  export declare interface OFSProjectFile {
@@ -4178,6 +4209,8 @@ export declare class OFSSymbologyPanel {
4178
4209
  private options;
4179
4210
  /** Renderer settings chosen in the form but not yet applied with "Classify" */
4180
4211
  private draft;
4212
+ /** Last real color of each color control, so switching "no color" off restores it */
4213
+ private colorMemory;
4181
4214
  constructor(legendTools: OFSLegendTools, options?: SymbologyPanelOptions);
4182
4215
  mount(target: HTMLElement | string): void;
4183
4216
  unmount(): void;
@@ -4189,6 +4222,9 @@ export declare class OFSSymbologyPanel {
4189
4222
  private render;
4190
4223
  /** Labels tab: field or expression, size, colour, halo and zoom range */
4191
4224
  private renderLabels;
4225
+ private colorKey;
4226
+ /** Color picker plus a "no color" (transparent) toggle */
4227
+ private colorControl;
4192
4228
  private renderClassification;
4193
4229
  private renderClassTable;
4194
4230
  private dashSelect;
@@ -4196,6 +4232,8 @@ export declare class OFSSymbologyPanel {
4196
4232
  private classify;
4197
4233
  private handleClick;
4198
4234
  private handleChange;
4235
+ /** Apply a form control's value (or an override, e.g. "no color") to the layer */
4236
+ private apply;
4199
4237
  }
4200
4238
 
4201
4239
  export declare class OFSThematicEngine extends TypedEventEmitter<ThematicEvents> {
@@ -5442,6 +5480,12 @@ export declare interface ThematicDefinition {
5442
5480
  enableSelectionHighlight?: boolean;
5443
5481
  /** Labels drawn for this layer */
5444
5482
  label?: LabelSettings;
5483
+ /**
5484
+ * Categorised: keep categories no feature has when the theme is reclassified, instead of dropping
5485
+ * them. For a fixed colour table - crop types, land-use codes - that should read the same whether or
5486
+ * not this season's data has every value yet.
5487
+ */
5488
+ keepEmptyCategories?: boolean;
5445
5489
  }
5446
5490
 
5447
5491
  export declare interface ThematicEngineOptions {