jmapcloud-ng-core-types 1.0.9 → 1.0.11

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/all-enums.ts CHANGED
@@ -139,16 +139,15 @@ export const ALL_LAYER_THEMATIC_FAMILY_TYPES: JLAYER_THEMATIC_FAMILY_TYPES[] = [
139
139
  export const ALL_LAYER_STYLE_TYPES: JLAYER_STYLE_TYPES[] = [
140
140
  JLAYER_STYLE_TYPES.POINT,
141
141
  JLAYER_STYLE_TYPES.LINE,
142
- JLAYER_STYLE_TYPES.SURFACE,
143
- JLAYER_STYLE_TYPES.ANNOTATION,
144
142
  JLAYER_STYLE_TYPES.IMAGE,
145
- JLAYER_STYLE_TYPES.MIXED
143
+ JLAYER_STYLE_TYPES.TEXT,
144
+ JLAYER_STYLE_TYPES.IMAGE
146
145
  ]
147
146
 
148
- export const ALL_LAYER_STYLE_ARROWS: JLAYER_STYLE_ARROWS[] = [
149
- JLAYER_STYLE_ARROWS.NONE,
150
- JLAYER_STYLE_ARROWS.FORWARD,
151
- JLAYER_STYLE_ARROWS.BACKWARD
147
+ export const ALL_LAYER_STYLE_ARROW_TYPES: JLAYER_STYLE_ARROW_TYPES[] = [
148
+ JLAYER_STYLE_ARROW_TYPES.NONE,
149
+ JLAYER_STYLE_ARROW_TYPES.FORWARD,
150
+ JLAYER_STYLE_ARROW_TYPES.BACKWARD
152
151
  ]
153
152
 
154
153
  export const ALL_LAYER_INFORMATION_REPORT_TYPES: JLAYER_INFORMATION_REPORT_TYPES[] = [
@@ -192,16 +191,16 @@ export const ALL_LAYER_DYNAMIC_FILTER_OPERATORS: JLAYER_DYNAMIC_FILTER_OPERATORS
192
191
  JLAYER_DYNAMIC_FILTER_OPERATORS.INTERVAL
193
192
  ]
194
193
 
195
- export const ALL_LAYER_STYLE_LINE_STROKE_CAP: JLAYER_STYLE_LINE_STROKE_CAP[] = [
196
- JLAYER_STYLE_LINE_STROKE_CAP.BUTT,
197
- JLAYER_STYLE_LINE_STROKE_CAP.ROUND,
198
- JLAYER_STYLE_LINE_STROKE_CAP.SQUARE
194
+ export const ALL_LAYER_STYLE_LINE_CAP: JLAYER_STYLE_LINE_CAP[] = [
195
+ JLAYER_STYLE_LINE_CAP.BUTT,
196
+ JLAYER_STYLE_LINE_CAP.ROUND,
197
+ JLAYER_STYLE_LINE_CAP.SQUARE
199
198
  ]
200
199
 
201
- export const ALL_LAYER_STYLE_LINE_STROKE_JOIN: JLAYER_STYLE_LINE_STROKE_JOIN[] = [
202
- JLAYER_STYLE_LINE_STROKE_JOIN.MITER,
203
- JLAYER_STYLE_LINE_STROKE_JOIN.ROUND,
204
- JLAYER_STYLE_LINE_STROKE_JOIN.BEVEL
200
+ export const ALL_LAYER_STYLE_LINE_JOIN: JLAYER_STYLE_LINE_JOIN[] = [
201
+ JLAYER_STYLE_LINE_JOIN.MITER,
202
+ JLAYER_STYLE_LINE_JOIN.ROUND,
203
+ JLAYER_STYLE_LINE_JOIN.BEVEL
205
204
  ]
206
205
 
207
206
  export const ALL_LAYER_METADATA_TYPES: JLAYER_METADATA_TYPES[] = [
package/index.ts CHANGED
@@ -329,6 +329,8 @@ export interface JLayerEventModule extends JEventModule {
329
329
  sourceChange(listenerId: string, fn: (params: JLayerEventParams) => void): void
330
330
  selectabilityWillChange(listenerId: string, fn: (params: JLayerEventSelectabilityParams) => void): void
331
331
  layerDeletion(listenerId: string, fn: (params: JLayerEventParams) => void): void
332
+ thematicAddition(listenerId: string, fn: (params: JAddMapThematicEventParams) => void): void
333
+ thematicDeletion(listenerId: string, fn: (params: JLayerThematicEventParams) => void): void
332
334
  initialSearchApplied(listenerId: string, fn: (params: JLayerInitialSearchEventParams) => void): void
333
335
  dynamicFilterSet(listenerId: string, fn: (params: JLayerDynamicFilterSetParams) => void): void
334
336
  dynamicFilterActivationChange(listenerId: string, fn: (params: JLayerDynamicFilterActivationParams) => void): void
@@ -696,6 +698,8 @@ export interface JMapService {
696
698
  isTerrainAvailable(): boolean
697
699
  isTerrainActive(): boolean
698
700
  setTerrainActive(active: boolean): void
701
+ setSelectionStyle(layerId: JId, style: JLayerSetStyleParams): void
702
+ resetSelectionStyle(layerId: JId): void
699
703
  setScaleControlVisibility(isVisible: boolean, position?: JMAP_POSITIONS): void
700
704
  setScaleControlUnits(units: "imperial" | "metric" | "nautical"): void
701
705
  setScaleControlPosition(position: JMAP_POSITIONS): void
@@ -895,6 +899,8 @@ export interface JLayerSearchService {
895
899
  }
896
900
 
897
901
  export interface JLayerThematicService {
902
+ addThematic(params: JLayerAddThematicParams): Promise<void>
903
+ deleteThematic(layerId: JId, thematicId: JId): void
898
904
  getAllByLayerId(layerId: JId): JLayerThematic[]
899
905
  getById(layerId: JId, thematicId: JId): JLayerThematic
900
906
  existsById(layerId: JId, thematicId: JId): boolean
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jmapcloud-ng-core-types",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "description": "JMap Cloud specific version of JMap Cloud NG Core types and interfaces",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/public/core.d.ts CHANGED
@@ -799,6 +799,190 @@ declare namespace JMap {
799
799
  * Methods used to manage thematics for a layer.
800
800
  */
801
801
  namespace Thematic {
802
+ /**
803
+ * ***JMap.Layer.Thematic.addThematic***
804
+ *
805
+ * This method allows you to add a custom thematic on a JMap Cloud layer. This method only works with vector layers that have attributes.
806
+ *
807
+ * The {@link JLayerAddThematicParams} parameter that you must provide include those properties:
808
+ * * the JMap Cloud layer id
809
+ * * a {@link JLayerUserStyleRule} specification
810
+ * * an array of {@link JLayerSetStyleParams}
811
+ *
812
+ * The id of the thematic that will be created will be the same id than the {@link JLayerUserStyleRule} that you provided.
813
+ *
814
+ * All objects that you provide that require an id should have a unique uuid v4 id. Many programming languages let you generate such ids.
815
+ *
816
+ * @param params the params to provide for the thematic creation
817
+ *
818
+ * @example
819
+ * ```ts
820
+ * // this code will add a custom thematic on a project that have a layer named "Neighborhood" with a "nom_qr" attribute.
821
+ * const addPolygonThematic = () => {
822
+ * // find layer Neighborhood
823
+ * const layer = JMap.Layer.getLayers().find(
824
+ * l => l.elementType === "POLYGON" && l.attributes.length > 0 && l.name === "Neighborhood"
825
+ * )
826
+ * if (!layer) {
827
+ * return
828
+ * }
829
+ * const layerAttribute = layer.attributes.find(la => la.name === "nom_qr")
830
+ * if (!layerAttribute) {
831
+ * return
832
+ * }
833
+ * const layerId = layer.id
834
+ * const styles = []
835
+ * const condition1StyleId = "8ae59ba6-0b0b-4a5e-8f8e-5b138bd53767"
836
+ * const condition2StyleId = "eeeff29c-352f-4ba6-b354-7d7f7476f1fc"
837
+ * const condition3StyleId = "85014948-1071-4257-a2f7-dbf75182fbfb"
838
+ * const condition4StyleId = "f111e616-c4a6-497b-aeda-57af63c312b8"
839
+ * const condition1Names = ["Anjou", "Beaconsfield", "Beaurivage", "Bois-Francs"]
840
+ * const condition2Names = ["Étienne Desmarteaux", "Ville-Émard", "Tétreaultville", "Saint-Sulpice"]
841
+ * const condition3Names = ["Westmount", "Saint-Henri", "Pierrefonds-Est", "Sault-au-Récollet"]
842
+ * styles.push(
843
+ * {
844
+ * id: condition1StyleId,
845
+ * type: "POLYGON",
846
+ * borderColor: "#ff0000",
847
+ * borderThickness: 4,
848
+ * fillColor: "#00ff00"
849
+ * },
850
+ * {
851
+ * id: condition2StyleId,
852
+ * type: "POLYGON",
853
+ * borderColor: "#00ff00",
854
+ * borderThickness: 4,
855
+ * fillColor: "#0000ff"
856
+ * },
857
+ * {
858
+ * id: condition3StyleId,
859
+ * type: "POLYGON",
860
+ * borderColor: "#0000ff",
861
+ * borderThickness: 4,
862
+ * fillColor: "#ff0000"
863
+ * },
864
+ * {
865
+ * id: condition4StyleId,
866
+ * type: "POLYGON",
867
+ * borderColor: "#000000",
868
+ * borderThickness: 4,
869
+ * fillColor: "#ffffff"
870
+ * }
871
+ * )
872
+ * const styleRule = {
873
+ * active: true,
874
+ * id: "bc23f628-0fea-4e0c-8c23-d39c33ee0be2",
875
+ * layerId: String(layer.id),
876
+ * name: "Demographic repartition",
877
+ * conditions: [
878
+ * {
879
+ * id: "573bf973-b574-46b5-b852-1bd17aa94c19",
880
+ * name: "Less than 50 000 people",
881
+ * conditionExpressions: [
882
+ * {
883
+ * id: "d6b1d717-b936-4b86-9011-6ce28af35237",
884
+ * operator: "IN",
885
+ * attribute: layerAttribute,
886
+ * value: condition1Names
887
+ * }
888
+ * ],
889
+ * styleMapScales: [
890
+ * {
891
+ * id: "a9ba5215-0511-4aa3-a724-6f14f10ab315",
892
+ * maximumVisibleZoom: 23,
893
+ * minimumVisibleZoom: 0,
894
+ * styleId: condition1StyleId
895
+ * }
896
+ * ]
897
+ * },
898
+ * {
899
+ * id: "a35679fa-860d-47d4-9b1a-24006bdd78be",
900
+ * name: "Between 50 000 and 100 000",
901
+ * conditionExpressions: [
902
+ * {
903
+ * id: "66de5d3b-5041-43d2-86b2-2639326ee6f7",
904
+ * operator: "IN",
905
+ * attribute: layerAttribute,
906
+ * value: condition2Names
907
+ * }
908
+ * ],
909
+ * styleMapScales: [
910
+ * {
911
+ * id: "8fb646bb-afee-4a3c-9545-e9716049d307",
912
+ * maximumVisibleZoom: 23,
913
+ * minimumVisibleZoom: 0,
914
+ * styleId: condition2StyleId
915
+ * }
916
+ * ]
917
+ * },
918
+ * {
919
+ * id: "4bd67df3-1ea3-4f3e-ad4b-1baa75a5cd5f",
920
+ * name: "More than 100 000 people",
921
+ * conditionExpressions: [
922
+ * {
923
+ * id: "2ff931ee-fa32-43e6-a3b1-314a806734c0",
924
+ * operator: "IN",
925
+ * attribute: layerAttribute,
926
+ * value: condition3Names
927
+ * }
928
+ * ],
929
+ * styleMapScales: [
930
+ * {
931
+ * id: "d0ad4bf4-f6a7-46f1-866b-74f97a5e7775",
932
+ * maximumVisibleZoom: 23,
933
+ * minimumVisibleZoom: 0,
934
+ * styleId: condition3StyleId
935
+ * }
936
+ * ]
937
+ * },
938
+ * {
939
+ * id: "25a4e4da-fe14-470d-aac2-37cfa7e367e2",
940
+ * name: "Other",
941
+ * conditionExpressions: [
942
+ * {
943
+ * id: "45f491d3-3a7b-4975-9296-7ff6e8516a6d",
944
+ * operator: "NOT_IN",
945
+ * attribute: layerAttribute,
946
+ * value: condition1Names.concat(condition2Names).concat(condition3Names)
947
+ * }
948
+ * ],
949
+ * styleMapScales: [
950
+ * {
951
+ * id: "94331295-86b3-455c-8946-d45f79b8bd21",
952
+ * maximumVisibleZoom: 23,
953
+ * minimumVisibleZoom: 0,
954
+ * styleId: condition4StyleId
955
+ * }
956
+ * ]
957
+ * }
958
+ * ]
959
+ * }
960
+ * JMap.Layer.Thematic.addThematic({ layerId, styleRule, styles })
961
+ * console.log(`added thematic on layer "${layer.name}", ids = "${layer.id}","${styleRule.id}" `)
962
+ * }
963
+ *
964
+ * if (JMap.Map.isMapLoaded()) {
965
+ * addPolygonThematic()
966
+ * } else {
967
+ * JMap.Event.Map.on.mapLoad("my-custom-event-map-load-add-polygon-thematic", () => {
968
+ * JMap.Event.Map.remove("my-custom-event-map-load-add-polygon-thematic")
969
+ * addPolygonThematic()
970
+ * })
971
+ * }
972
+ * ```
973
+ */
974
+ function addThematic(params: JLayerAddThematicParams): Promise<void>
975
+
976
+ /**
977
+ * ***JMap.Layer.Thematic.addThematic***
978
+ *
979
+ * Deletes a thematic from JMap CLoud NG. The removal is client-side only and only for the current session.
980
+ *
981
+ * @param layerId the JMap Cloud layer id
982
+ * @param thematicId the thematic id (Style Rule id)
983
+ */
984
+ function deleteThematic(layerId: JId, thematicId: JId): void
985
+
802
986
  /**
803
987
  * ***JMap.Layer.Thematic.getAllByLayerId***
804
988
  *
@@ -3114,6 +3298,38 @@ declare namespace JMap {
3114
3298
  */
3115
3299
  function setTerrainActive(active: boolean): void
3116
3300
 
3301
+ /**
3302
+ * ***JMap.Map.setSelectionStyle***
3303
+ *
3304
+ * Sets the selection style for a specified JMap Cloud layer.
3305
+ *
3306
+ * When specified symbolData must be a data URL with a base64 encode PNG, JPEG or WEBP image. SVGs are not supported for the moment.
3307
+ *
3308
+ * @param layerId the JMap Cloud layer id
3309
+ * @param style the selection style
3310
+ * @example
3311
+ * ```ts
3312
+ * // define and apply a selection style to a polygone layer
3313
+ * JMap.Map.setSelectionStyle("polygon-layer-id", {type: "POLYGON", fillColor: "#ff0000", borderColor: "#0000ff", borderThickness: 8})
3314
+ *
3315
+ * // define and apply a selection style to a line layer
3316
+ * JMap.Map.setSelectionStyle("line-layer-id",{type:"LINE", lineColor:"#ff0000", lineThickness:4})
3317
+ *
3318
+ * // define and apply a selection style to a point layer
3319
+ * JMap.Map.setSelectionStyle("point-layer-id",{type:"POINT", symbolData:"data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAACCElEQVR4XmNgwAH2vHQWjy9TOs/KxvQTyP2PC7NxMP0WlWSrBrKZELoJgI41Rtl6lgK/DG2FQIb8A2J7dDVQYM/IyPAfpFZYgv0akK+MrgADVM/SnS8oyva/eILW/1N/Pf+zsTN9Z8BhAUgtDz8LWB1IPQcX8xcGHGrBoH+LaRDIcJdQyf1A7gcGLEGCC4Mcktag+p+FlfE9kC8BNhAd+MRLP/ZLkgG54i0DPpdgB/a8Aqx/3SKkngLZfeiSDLMPWmgCFfyvnat7Csg9hy5PDJBV4f7Qt9H4PxMT40cglwtFMqNJvdPARvB/aLb8ZiB3NookkcDITvhs5XSd/6JS7DeBXGcUSZ846QvJNSr/FTV5dgK5GSiSRAI7X7GpASmy/0FmAbnNKJLaZvzfp+0x/8/KxngZyDVFkSQSWLiJeqob8v2fuNX0OZB7GEUSmKH+H/nqDkoRv4CYHUWSeMAOTEUwc0AZFAX8P/PfC5bsKAE4zQFL4MtYhAAs4+G0gAYYBYBtxoZxyeESh8mhmQ9RDPImA4nFBAyDgnfWAQv8FjBADLcHYeTwRHchsjguPXCToQAsAYtk9AhDNxxZHJceFNNhikFeBCkCYTTvYsUE9KAADBeiuxQd4xKHyaGZj+k6KmAEQE4BlGKklIgC7KGC6K4gB8NSFVYAdwmIjS6JA5CkhyTFUIBTDwBPxSZtxNLgXwAAAABJRU5ErkJggg=="})
3320
+ * ```
3321
+ */
3322
+ function setSelectionStyle(layerId: JId, style: JLayerSetStyleParams): void
3323
+
3324
+ /**
3325
+ * ***JMap.Map.resetSelectionStyle***
3326
+ *
3327
+ * Sets back the selection style of a layer to its original value. Use this method when the selection style has been modified by {@link JMap.Map.setSelectionStyle} and the style modification is not needed anymore.
3328
+ *
3329
+ * @param layerId the JMap Cloud layer id
3330
+ */
3331
+ function resetSelectionStyle(layerId: JId): void
3332
+
3117
3333
  /**
3118
3334
  * ***JMap.Map.setScaleControlVisibility***
3119
3335
  *
@@ -8420,6 +8636,46 @@ declare namespace JMap {
8420
8636
  */
8421
8637
  function layerDeletion(listenerId: string, fn: (params: JLayerEventParams) => void): void
8422
8638
 
8639
+ /**
8640
+ * ***JMap.Event.Layer.on.thematicDeletion***
8641
+ *
8642
+ * This event is triggered when a thematic is deleted.
8643
+ *
8644
+ * @param listenerId Your listener id (must be unique for all layer events)
8645
+ * @param fn Your listener function
8646
+ * @example
8647
+ * ```ts
8648
+ * // Each time a thematic is deleted, will display a message in the console
8649
+ * JMap.Event.Layer.on.thematicDeletion(
8650
+ * "custom-thematic-deletion",
8651
+ * params => {
8652
+ * console.log(`Thematic id="${params.thematicId}" of layer id="${params.layerId}" has been deleted client-side`)
8653
+ * }
8654
+ * )
8655
+ * ```
8656
+ */
8657
+ function thematicDeletion(listenerId: string, fn: (params: JLayerThematicEventParams) => void): void
8658
+
8659
+ /**
8660
+ * ***JMap.Event.Layer.on.thematicAddition***
8661
+ *
8662
+ * This event is triggered when a custom thematic is added.
8663
+ *
8664
+ * @param listenerId Your listener id (must be unique for all layer events)
8665
+ * @param fn Your listener function
8666
+ * @example
8667
+ * ```ts
8668
+ * // Each time a custom thematic is added, will display a message in the console
8669
+ * JMap.Event.Layer.on.thematicAddition(
8670
+ * "custom-thematic-addition",
8671
+ * params => {
8672
+ * console.log(`Thematic has been added for layer id="${params.layerId}". Params: `, params)
8673
+ * }
8674
+ * )
8675
+ * ```
8676
+ */
8677
+ function thematicAddition(listenerId: string, fn: (params: JAddMapThematicEventParams) => void): void
8678
+
8423
8679
  /**
8424
8680
  * ***JMap.Event.Layer.on.initialSearchApplied***
8425
8681
  *
@@ -65,14 +65,13 @@ declare const enum JLAYER_THEMATIC_FAMILY_TYPES {
65
65
  declare const enum JLAYER_STYLE_TYPES {
66
66
  POINT = "POINT",
67
67
  LINE = "LINE",
68
- SURFACE = "SURFACE",
69
- ANNOTATION = "ANNOTATION",
70
- IMAGE = "IMAGE",
71
- MIXED = "MIXED"
68
+ POLYGON = "POLYGON",
69
+ TEXT = "TEXT",
70
+ IMAGE = "IMAGE"
72
71
  }
73
72
 
74
73
  // ALL_LAYER_STYLE_ARROWS in all-enum.ts
75
- declare const enum JLAYER_STYLE_ARROWS {
74
+ declare const enum JLAYER_STYLE_ARROW_TYPES {
76
75
  NONE = "NONE",
77
76
  FORWARD = "FORWARD",
78
77
  BACKWARD = "BACKWARD"
@@ -99,7 +98,9 @@ declare const enum JLAYER_STYLE_RULE_CONDITION_EXPRESSION_OPERATORS {
99
98
  GREATER_THAN = "GREATER_THAN",
100
99
  LOWER_THAN = "LOWER_THAN",
101
100
  GREATER_OR_EQUALS_TO = "GREATER_OR_EQUALS_TO",
102
- LOWER_OR_EQUALS_TO = "LOWER_OR_EQUALS_TO"
101
+ LOWER_OR_EQUALS_TO = "LOWER_OR_EQUALS_TO",
102
+ IN = "IN", // This operator does not yet exist in JMC
103
+ NOT_IN = "NOT_IN" // This operator does not yet exist in JMC
103
104
  }
104
105
 
105
106
  // ALL_LAYER_DYNAMIC_FILTER_OPERATORS in all-enum.ts
@@ -122,15 +123,15 @@ declare const enum JLAYER_DYNAMIC_FILTER_OPERATORS {
122
123
  INTERVAL = "INTERVAL"
123
124
  }
124
125
 
125
- // ALL_LAYER_STYLE_LINE_STROKE_CAP in all-enum.ts
126
- declare const enum JLAYER_STYLE_LINE_STROKE_CAP {
126
+ // ALL_LAYER_STYLE_LINE_CAP in all-enum.ts
127
+ declare const enum JLAYER_STYLE_LINE_CAP {
127
128
  BUTT = "BUTT",
128
129
  ROUND = "ROUND",
129
130
  SQUARE = "SQUARE"
130
131
  }
131
132
 
132
- // ALL_LAYER_STYLE_LINE_STROKE_JOIN in all-enum.ts
133
- declare const enum JLAYER_STYLE_LINE_STROKE_JOIN {
133
+ // ALL_LAYER_STYLE_LINE_JOIN in all-enum.ts
134
+ declare const enum JLAYER_STYLE_LINE_JOIN {
134
135
  MITER = "MITER",
135
136
  ROUND = "ROUND",
136
137
  BEVEL = "BEVEL"
@@ -223,6 +224,16 @@ declare interface JLayerEventParams {
223
224
  layerId: JId
224
225
  }
225
226
 
227
+ declare interface JLayerThematicEventParams {
228
+ layerId: JId
229
+ thematicId: JId
230
+ }
231
+
232
+ declare interface JAddMapThematicEventParams {
233
+ layerId: JId
234
+ layerSpecifications: maplibregl.LayerSpecification[]
235
+ }
236
+
226
237
  declare interface JLayerInitialSearchEventParams extends JLayerEventParams {
227
238
  features: GeoJSON.Feature[]
228
239
  }
@@ -301,7 +312,8 @@ declare interface JLayer extends JLayerTreeElement {
301
312
  forms: JLayerForm[]
302
313
  hasInformationReport: boolean
303
314
  informationReports: JLayerInformationReport[]
304
- spatialDataSourceId: string // For JMap Cloud only
315
+ spatialDataSourceId: string
316
+ selectionStyleId: string
305
317
  dynamicFilter: JDynamicFilter
306
318
  }
307
319
 
@@ -382,6 +394,7 @@ declare interface JLayerThematicClassification extends JLayerThematic {
382
394
  }
383
395
 
384
396
  declare interface JLayerThematicStyleRule extends JLayerThematic {
397
+ type: JLAYER_THEMATIC_TYPES.STYLE_RULE
385
398
  conditions: JLayerThematicCondition[]
386
399
  hiddenConditionIds: string[]
387
400
  }
@@ -400,7 +413,7 @@ declare interface JLayerThematicConditionScaledStyle {
400
413
 
401
414
  declare interface JLayerThematicCategory {
402
415
  title: string
403
- style: JLayerStyle
416
+ style: JLayerBaseStyle
404
417
  enabled: boolean
405
418
  nullValueCategory: boolean
406
419
  index: number
@@ -439,6 +452,7 @@ declare interface JLayerStyleRule {
439
452
  declare interface JLayerStyleRuleCondition {
440
453
  id: string
441
454
  name: string
455
+ conditionExpressions: JLayerStyleRuleConditionExpression[]
442
456
  styleMapScales: JLayerStyleScaled[]
443
457
  }
444
458
 
@@ -454,108 +468,85 @@ declare interface JLayerStyleSample {
454
468
  imageSampleInBase64: string
455
469
  }
456
470
 
457
- // @TODO we probably don't need this interface anymore
458
471
  declare interface JLayerStyleRuleConditionExpression {
472
+ id: string
459
473
  operator: JLAYER_STYLE_RULE_CONDITION_EXPRESSION_OPERATORS
460
474
  value: any
461
475
  attribute: JLayerAttribute
462
476
  }
463
477
 
464
- declare interface JLayerStyle {
465
- styleType: JLAYER_STYLE_TYPES
478
+ declare interface JLayerBaseStyle {
479
+ type: JLAYER_STYLE_TYPES
480
+ id: string
481
+ name: string
482
+ /**
483
+ * @deprecated
484
+ * this property will be removed once the legacy support for JMS thematics will be removed
485
+ */
466
486
  imageSampleInBase64: string
467
- transparencyPerCent: number
468
- }
469
-
470
- declare interface JLayerStyleVector extends JLayerStyle {
471
- antiAliasing: boolean
472
- }
473
-
474
- declare interface JLayerStylePoint extends JLayerStyleVector {
475
- styleType: JLAYER_STYLE_TYPES.POINT
476
- symbolScale: number
477
- symbolRotationInDegree: number
478
- symbolProportionalSizeEnabled: boolean
479
- symbolProportionalSize: number
480
- symbolRotateWithMapEnabled: boolean
481
- symbolOffsetX: number
482
- symbolOffsetY: number
483
- symbolVector: JLayerStyleSymbolVector | null
484
- symbolImage: JLayerStyleSymbolImage | null
487
+ transparency: number
485
488
  }
486
489
 
487
- declare interface JLayerStyleLineStroke {
488
- width: number
489
- cap: JLAYER_STYLE_LINE_STROKE_CAP
490
- join: JLAYER_STYLE_LINE_STROKE_JOIN
490
+ declare interface JLayerImageStyle extends JLayerBaseStyle {
491
+ type: JLAYER_STYLE_TYPES.IMAGE
491
492
  }
492
493
 
493
- declare interface JLayerStyleLineStrokeBasic extends JLayerStyleLineStroke {
494
- miterLimit: number
495
- dash: number[]
496
- dash_phase: number
494
+ declare interface JLayerPointStyle extends JLayerBaseStyle {
495
+ type: JLAYER_STYLE_TYPES.POINT
496
+ size: number
497
+ rotation: number
498
+ rotationLocked: boolean
499
+ proportional: boolean
500
+ proportionalScale: number
501
+ symbolOffset: [number, number]
502
+ symbolData: string
497
503
  }
498
504
 
499
- declare interface JLayerStyleLine extends JLayerStyleVector {
500
- styleType: JLAYER_STYLE_TYPES.LINE
501
- lineColor: JRGBColor
505
+ declare interface JLayerLineStyle extends JLayerBaseStyle {
506
+ type: JLAYER_STYLE_TYPES.LINE
502
507
  lineThickness: number
503
- arrowType: JLAYER_STYLE_ARROWS
504
- arrowPositionFromLeftInPerCent: number
505
- stroke: JLayerStyleLineStroke
506
- }
507
-
508
- declare interface JLayerStyleSurface extends JLayerStyleVector {
509
- styleType: JLAYER_STYLE_TYPES.SURFACE
510
- fillColor: JRGBColor
508
+ lineColor: string
509
+ arrowType: JLAYER_STYLE_ARROW_TYPES
510
+ arrowPosition: number
511
+ lineCap: JLAYER_STYLE_LINE_CAP
512
+ lineJoin: JLAYER_STYLE_LINE_JOIN
513
+ dashPattern: number[]
514
+ patternData: string
515
+ }
516
+
517
+ declare interface JLayerPolygonStyle extends JLayerBaseStyle {
518
+ type: JLAYER_STYLE_TYPES.POLYGON
519
+ fillColor: string
520
+ borderColor: string
511
521
  transparentFill: boolean
512
- borderColor: JRGBColor
513
- borderTransparencyInPercent: number
514
522
  borderThickness: number
515
- surfacePattern: string
516
- patternColor: JRGBColor
517
- patternTransparentFill: boolean
523
+ borderTransparency: number
524
+ borderDashPattern: number[]
525
+ borderPatternData: string
526
+ patternData: string
518
527
  }
519
528
 
520
- declare interface JLayerStyleAnnotation extends JLayerStyleVector {
521
- styleType: JLAYER_STYLE_TYPES.ANNOTATION
522
- textFont: string
523
- textColor: JRGBColor
524
- textBold: boolean
525
- textItalic: boolean
526
- textUnderlined: boolean
527
- textStrikeThrough: boolean
528
- textOutlined: boolean
529
- textOutlineColor: JRGBColor
529
+ declare interface JLayerTextStyle extends JLayerBaseStyle {
530
+ type: JLAYER_STYLE_TYPES.TEXT
531
+ textColor: string
532
+ outlineColor: string
533
+ bold: boolean
534
+ italic: boolean
530
535
  }
531
536
 
532
- declare interface JLayerStyleMixed extends JLayerStyleVector {
533
- styleType: JLAYER_STYLE_TYPES.MIXED
534
- point: JLayerStylePoint
535
- line: JLayerStyleLine
536
- surface: JLayerStyleSurface
537
- text: JLayerStyleAnnotation
538
- }
539
-
540
- declare interface JLayerStyleSymbolImage {
541
- absoluteFilePath: string
542
- }
537
+ declare type JLayerUserStyleRule = Omit<JLayerStyleRule, "defaultRule">
543
538
 
544
- declare interface JLayerStyleSymbolVector {
545
- vectorSymbol: string
546
- borderThickness: number
547
- borderColor: JRGBColor
548
- transparentFill: boolean
549
- fillColor: JRGBColor
539
+ declare type JLayerAddThematicParams = {
540
+ layerId: JId
541
+ styleRule: JLayerUserStyleRule
542
+ styles: JLayerSetStyleParams[]
550
543
  }
551
544
 
552
- declare interface JRGBColor {
553
- red: number
554
- green: number
555
- blue: number
556
- alpha: number
557
- hexa: string
558
- }
545
+ declare type JLayerSetStyleParams =
546
+ | (Pick<JLayerLineStyle, "type"> & Partial<Pick<JLayerLineStyle, "id" | "lineColor" | "lineThickness">>)
547
+ | (Pick<JLayerPolygonStyle, "type"> &
548
+ Partial<Pick<JLayerPolygonStyle, "id" | "fillColor" | "borderColor" | "borderThickness">>)
549
+ | (Pick<JLayerPointStyle, "type"> & Partial<Pick<JLayerPointStyle, "id" | "symbolData">>)
559
550
 
560
551
  declare interface JLayerSetLayersVisibilityParams {
561
552
  layerId: JId